Ghost.py icon indicating copy to clipboard operation
Ghost.py copied to clipboard

Exception: Unable to load requested page

Open kravietz opened this issue 11 years ago • 13 comments

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.

kravietz avatar Apr 04 '13 13:04 kravietz

Can you provide the real URL you have it crashing with?

arikfr avatar Apr 04 '13 13:04 arikfr

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.

dregin avatar Apr 16 '13 14:04 dregin

Hi,

I'm having the exact same problem, with any url. I'm using the package from pypi.

Thanks

aleray avatar Apr 20 '13 23:04 aleray

I just had this problem with a few URLs too and there were varying reasons. For those still having this problem, two recommendations:

  1. Try curling the URL in a standard terminal first. See if any irregularities stand out.
  2. (If no irregularities in step 1) @dregin's recommendation to increase wait_timeout is solid, but you don't need to edit ghost.py to accomplish this anymore. You can simply set wait_timeout during your Ghost instantiation. E.g., ghost = Ghost(wait_timeout=999)

thetylerhayes avatar Sep 08 '13 21:09 thetylerhayes

Was this ever resolved?

macdonjo avatar Jan 12 '14 03:01 macdonjo

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.

taliastocks avatar Sep 26 '14 14:09 taliastocks

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')

cisco08 avatar Oct 05 '14 17:10 cisco08

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-efi avatar Nov 03 '14 13:11 the-efi

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).

socrateslee avatar Jun 11 '15 00:06 socrateslee

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)

robd518 avatar Aug 17 '15 18:08 robd518

@muddafugga Thanks! it works for me

dbr7 avatar Feb 09 '16 14:02 dbr7

session.wait_timeout = 999 worked

frank0718 avatar Oct 01 '16 01:10 frank0718

@frank0718 yes ,it works, but the process is blocked ,still waiting. I think selenium+ phantomjs is more stable than Ghost.py

mickelfeng avatar May 05 '17 03:05 mickelfeng