jeanphix/Ghost.py

qt - WARNING - ghost: Fatal IO error: client killed

CJSoldier opened this issue · 2 comments

Hi jeanphix, I've been troubled about this problem for a long time.
It works well when ran on windows,but when I put it in a ubuntu14.04 docker environment,It often comes out this error silently. Sometimes it doesn't event have an error and just exits. My windows environment is win7x64, pyqt4, python2.7.

I pulled the docker image from here https://hub.docker.com/r/netmarkjp/ghost-py/. The images uses pyside. I use pyqt4 on windows.
I don't know where I did wrong,help me please.

def collectCookies(url, needJsessionid): cj = RequestsCookieJar() g = ghost.Ghost() finalCookieStr = '' with g.start() as session: head={"Referer": url} # get __jsluid and __jsl_clearance page, extra_resources = session.open(url,method='get', headers=head,wait=True,encode_url=True, user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36") time.sleep(random.uniform(2, 4)) # get JSESSIONID if needJsessionid: try: page, extra_resources = session.open(url,method='get', headers=head,wait=True,encode_url=True, user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36") except Exception: # try again page, extra_resources = session.open(url,method='get', headers=head,wait=True,encode_url=True, user_agent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36") session.save_cookies(cj) time.sleep(random.uniform(3, 5)) for ck in cj: finalCookieStr = finalCookieStr + ck.name + '=' + ck.value + ';' return finalCookieStr

I also met the same problem , Could you tell me how do you solve ?

@wh836627932
try:

sudo apt-get install xvfb
xvfb-run --auto-servernum --server-args="-screen 0 1280x760x24"  python your_python_file.py