2

我正在使用 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

我怎样才能找到这个问题的根源?

4

1 回答 1

1

通常当你遇到这样的崩溃而不是常规的Python 异常时,问题出在 C 代码的某个地方,通常在第三方库中。

您提供了一个产生错误的最小程序,这很棒。我自己从来没有使用过 Ghost,所以这个答案只是我最好的猜测,因为你还没有得到任何其他答案。

尝试使您的程序更加精简。以下程序是否也会崩溃?

from ghost import Ghost
gh = Ghost()

如果不是,您是否以错误的方式使用其中一种方法?仔细阅读Ghost 文档并确保您以正确的方式使用该库。例如,我找到了方法,但只在一个似乎有点过时create_page的在线文档中找到。这里也有一些文档。

获取最新版本的库并使用包含的文档,或者自己生成。

最后,该文档还对 PyQt/PySide 进行了以下说明:

首先你需要安装 PyQt 或 PySide。这需要先安装 QT 框架。您可以在以下链接 http://www.riverbankcomputing.com/software/pyqt/download中找到 PyQt

所以问题也可能与您的 PyQt/PySide 安装有关,但我认为这不是 StackOverflow 的问题。

于 2014-03-11T09:58:44.277 回答