jeanphix / Ghost.py

Webkit based scriptable web browser for python.
http://ghost-py.readthedocs.org/en/latest/
2.76k stars 380 forks source link

Is the documentation uptodate? #304

Open paintdog opened 8 years ago

paintdog commented 8 years ago

The examples in the documentation didn't worked for me. I looked at the source and then I tried the following lines, which did the job:

`from ghost import Ghost, Session

ghost = Ghost()

ghost = Session(ghost)

ghost.open('http://www.google.com')

ghost.capture_to('screen_shot.png')`

Nice tool, this example maybe helpful for others - I hope.

isurusam commented 8 years ago

This one is working and the one in the documentation doesn't. Thanks..

GrexAut commented 8 years ago

I get an appcrash from python :( - Tried so much, if I take the code from here http://ghost-py.readthedocs.io/en/latest/#installation It works, but If I change the URL, appcrash from python.exe Code:

from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
    page, extra_resources = session.open("http://google.com")
    assert page.http_status == 200 and 'jeanphix' in page.content

The funny part is, that the code you post save the screen_shot.png, but crashes...