对于这个例子,我知道使用 requests 或类似的 python 模块更容易。
但我需要用 ghost.py 模块来做
此代码示例不起作用:
from ghost import Ghost
ghost = Ghost()
with ghost.start() as session:
page, extra_resources = session.open('http://www.7-zip.org/a/7z1506-x64.exe')
with open('7z1506-x64.exe', 'wb') as file:
file.write(session.http_resources)