Ghost.py
Ghost.py copied to clipboard
Exception: Unable to load requested page
Latest GitHub clone is unable to load more complex pages and it crashes on timeouts. Small pages load, but if the page has any external content (like images) I get this exception:
>>> g.open('http://example.com/glb_home/en/home.jsp')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/Ghost.py-0.1b2-py2.7.egg/ghost/ghost.py", line 560, in open
return self.wait_for_page_loaded()
File "/usr/local/lib/python2.7/dist-packages/Ghost.py-0.1b2-py2.7.egg/ghost/ghost.py", line 774, in wait_for_page_loaded
'Unable to load requested page')
File "/usr/local/lib/python2.7/dist-packages/Ghost.py-0.1b2-py2.7.egg/ghost/ghost.py", line 755, in wait_for
raise Exception(timeout_message)
Exception: Unable to load requested page
Looking at sniffer output I see that Ghost actually requests all these external files (and receives them), but then it somehow crashes on a timeout. I tested it on many pages and it was consistent behavior.
Can you provide the real URL you have it crashing with?
I'm seeing this error for http://www.daftdrop.com/#!searchView?houseId=690094
I worked around it by increasing wait_timeout in ghost.py from 8 to 999.
Hi,
I'm having the exact same problem, with any url. I'm using the package from pypi.
Thanks
I just had this problem with a few URLs too and there were varying reasons. For those still having this problem, two recommendations:
- Try curling the URL in a standard terminal first. See if any irregularities stand out.
- (If no irregularities in step 1) @dregin's recommendation to increase
wait_timeout
is solid, but you don't need to editghost.py
to accomplish this anymore. You can simply setwait_timeout
during your Ghost instantiation. E.g.,ghost = Ghost(wait_timeout=999)
Was this ever resolved?
Still having this issue. It looks as though this is related to https://github.com/jeanphix/Ghost.py/issues/32. The solution is not to use the command line to run ghost.
i get it on ghost.py-0.1b3-py2.7 and pyside 1.2.1 change the file ghost.py on line 915 add 'self.loaded=True' def wait_for_page_loaded(self): """Waits until page is loaded, assumed that a page as been requested. """ self.loaded=True self.wait_for(lambda: self.loaded, 'Unable to load requested page')
Doesn't work for me with OS X Yosemite and PyQt4 ("unable to load"). But strangely it does work after installing PySide ("brew install pyside").
the same as mintigo-efi on ubuntu 14.04, got the timeout exception with pyqt4 but working after installing pyside(apt-get install python-pyside).
Wow am I late to this party! I also had luck in setting the timeout higher than the default of 8. Some things must have also changed in the code since OP, because ghost = Ghost(wait_timeout=999) doesn't work. I am able to get it to work by doing the following: ghost = Ghost() session = ghost.start() session.wait_timeout = 999 session.open(your url)
@muddafugga Thanks! it works for me
session.wait_timeout = 999 worked
@frank0718 yes ,it works, but the process is blocked ,still waiting. I think selenium+ phantomjs is more stable than Ghost.py