python - Flask and PhantomJS, Evaluate internal URL -


i'm need evaluate internal url within flask (0.10.1) using phantomjs (1.9.8). if substitute http://www.google.com url correctly evaluates. if serve html on ip correctly evaluates. when try use internal url page hangs , receive 502 bad gateway. i've been struggling weeks. has calling internal url inside flask app, don't know how around this. appreciated.

controllers.py

from selenium import webdriver import os phantomjs = os.path.expanduser('/usr/local/bin/phantomjs') log = os.path.expanduser('/home/www/tmp/ghostdriver.log')  driver = webdriver.phantomjs(phantomjs, service_log_path=log) driver.get('http://localhost/calendar') html = driver.page_source  return render_template('{{html}}.html', html=html) 

ghostdriver.log

 phantomjs launching ghostdriver... [info  - 2016-01-07t19:40:33.072z] ghostdriver - main - running on port 43105 [info  - 2016-01-07t19:40:33.927z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - page.settings - {"xssauditingenabled":false,"javascriptcanclosewindows":true,"javascriptcanopenwindows":true,"javascriptenabled":true,"loadimages":true,"localtoremoteurlaccessenabled":false,"useragent":"mozilla/5.0 (unknown; linux x86_64) applewebkit/534.34 (khtml, gecko) phantomjs/1.9.8 safari/534.34","websecurityenabled":true} [info  - 2016-01-07t19:40:33.927z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - page.customheaders:  - {} [info  - 2016-01-07t19:40:33.927z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - session.negotiatedcapabilities - {"browsername":"phantomjs","version":"1.9.8","drivername":"ghostdriver","driverversion":"1.1.0","platform":"linux-unknown-64bit","javascriptenabled":true,"takesscreenshot":true,"handlesalerts":false,"databaseenabled":false,"locationcontextenabled":false,"applicationcacheenabled":false,"browserconnectionenabled":false,"cssselectorsenabled":true,"webstorageenabled":false,"rotatable":false,"acceptsslcerts":false,"nativeevents":true,"proxy":{"proxytype":"direct"}} [info  - 2016-01-07t19:40:33.927z] sessionmanagerreqhand - _postnewsessioncommand - new session created: 848c6530-b576-11e5-86dc-813b8c0d63bb [error - 2016-01-07t19:41:03.375z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - page.onerror - msg: typeerror: 'undefined' not function (evaluating 'this.update.bind(this)') [error - 2016-01-07t19:41:03.375z] session [848c6530-b576-11e5-86dc-813b8c0d63bb] - page.onerror - stack:   headroom (http://localhost/static/js/headroom/headroom.js:117)   (anonymous function) (http://localhost/static/js/headroom/jquery.headroom.js:26)   (anonymous function) (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2)   (anonymous function) (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2)   (anonymous function) (http://localhost/static/js/headroom/jquery.headroom.js:33)   (anonymous function) (http://localhost/static/js/custom.js:184)   (anonymous function) (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2)   (anonymous function) (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2)   (anonymous function) (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2)   (http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js:2) 

nginx error.log

 2016/01/07 14:41:02 [error] 924#0: *39 upstream prematurely closed connection while reading response header upstream, client: xxx.xxx.xx.xxx, server: , request: "post /taper/ http/1.1", upstream: "http://127.0.0.1:8000/taper/", host: "localhost", referrer: "http://localhost/taper/" 


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -