Here is the simple program which does not work
from ghost import Ghost
ghost = Ghost(wait_timeout=40)
page, extra_resources = ghost.open("http://samsung.com/in/consumer/mobile-phone/mobile-phone/smartphone/")
ghost.wait_page_loaded()
n=2;
links=ghost.evaluate("alist=document.getElementsByTagName('a');alist")
print links
ERROR IS: raise Exception(timeout_message)
Exception: Unable to load requested page
iS there some problem with the program?
Seem like people are reporting similar issues to yours, without really getting any explanation (for example: https://github.com/jeanphix/Ghost.py/issues/26)
Adjust the evaluate line to the following, which is referenced by a ghost.py documentation:
ghost.py requires either PySide (preferred) or PyQt Qt bindings:
try install pyside instead of pyqt. this work for me.
I had to add extra logic in the ghost.py wait_for_page_loaded func:
PyQt was adding stupid junk to resource.url, so url==resource.url could never load a page properly.
I was getting this error with every page I tried when I first got Ghost.py, the way I went about solving it was I scrapped PyQt and installed PySide instead. That fixed it for me anyway.