jeanphix/Ghost.py

set_proxy not working when proxy username/password provided

skyland06 opened this issue · 0 comments

Hi, this is my first time to use ghost.py, this is really awesome project, I need it badly, while I got error when I provide a username/password pair to the proxy server, the page won't load anymore, but the firefox works when I gave the username/password to it. here is my code:

!/usr/bin/python

from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
session.set_proxy('http', '58.96.184.54', 62001, 'kunzhipeng', 'bey2014')
session.wait_for_page_loaded(60)
session.wait_timeout = 60
page, extra_resources = session.open("http://www.amazon.com")
assert page.http_status == 200 and 'amazon' in page.content
session.capture_to("/home/rabbit/xxxx.png")

Can anyone help me ? much appreciated.