Python.exe因Ghost.py崩溃
我正在使用Ghost.py这个工具。
from ghost import Ghost
url = "http://www.kiev.prom.ua"
gh = Ghost()
page, page_name = gh.create_page()
page_resource = page.open(url, wait_onload_event=True)
当我运行上面的脚本时,Python程序崩溃了:
Problem Event Name: APPCRASH
Application Name: python.exe
Application Version: 0.0.0.0
Application Timestamp: 4c303241
Name of the module with the error: python27.dll
Version of the module with the error: 2.7.5150.1013
The time stamp module with the error: 5237f3d5
Exception Code: c0000005
Exception Offset: 00107f7a
OS Version: 6.1.7601.2.1.0.256.1
Language Code: 1049
Additional Information 1: 0a9e
Additional information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
我该如何找到这个问题的原因呢?
1 个回答
1
通常,当你遇到这样的崩溃,而不是常规的Python异常时,问题通常出在C语言代码里,通常是某个第三方库的问题。
你提供了一个能复现错误的简化程序,这很好。我自己没有用过Ghost,所以这个回答只是我的一些猜测,因为你还没有得到其他的回答。
试着让你的程序更简化一些。下面这个程序也会崩溃吗?
from ghost import Ghost
gh = Ghost()
如果不会,那你是不是用错了某些方法?仔细阅读Ghost的文档,确保你正确使用这个库。比如,我找到了create_page
这个方法,但只在一个看起来有点过时的在线文档里找到。这里还有一些文档可以参考。
获取这个库的最新版本,并使用随附的文档,或者自己生成文档。
最后,文档里还提到关于PyQt/PySide的内容:
首先,你需要安装PyQt或PySide。这需要先安装QT框架。你可以在以下链接找到PyQt:http://www.riverbankcomputing.com/software/pyqt/download
所以问题也可能出在你的PyQt/PySide安装上,但我觉得这不是StackOverflow上应该讨论的问题。