这是我的代码:
from ghost import Ghost
import time,sys,os
url="http://www.endclothing.com/au/valentino-rockrunner-sneaker-ky0s0723-dnc-0ac.html"
gh=Ghost()
session=gh.start()
try:
page_resource=session.open(url,timeout=999)
except Exception as e:
print "Major error has occurred, cant load webpage!"
print e
raw_input("PRESS ENTER TO EXIT!")
sys.exit()
session.wait_for_page_loaded()
session.capture_to("preview.jpg")
try:
os.startfile("preview.jpg")
except Exception:
print "Cant look at preview"
现在,每当我查看预览时,页面都没有正确加载。我到处搜索试图找出问题所在,但我找不到解决方案。不过,当我在 www.google.com 上尝试时,它可以完美运行。