1. 程式人生 > >Python ghost.py 0.2版簡單例項

Python ghost.py 0.2版簡單例項

from ghost import Ghost

ghost = Ghost()

with ghost.start() as session:

  page, extra_resources = session.open("http://www.baidu.com")

if page.http_status == 200 and 'accountName' in page.content:

   print(page.content)

具體區別看文件:http://ghost-py.readthedocs.io/en/latest/