2

我尝试在 python 上使用boilerpipe 库,旨在从大学项目的页面中提取文本。我创建了一个简单的代码来进行提取:

from boilerpipe.extract import Extractor
def Article(url):
    extractor = Extractor(extractor='ArticleExtractor', url=your_url)
    extracted_text = extractor.getText()
    return extracted_text

当我尝试运行时遇到的错误是:

>Traceback (most recent call last):
>  File "C:\Python27\Boiler.py", line 1, in <module>
>    from boilerpipe.extract import Extractor
>  File "C:\Python27\lib\site-packages\boilerpipe-1.2.0-py2.7.egg\boilerpipe\__init__.py", >line 10, in <module>
>    jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s" % >os.pathsep.join(jars))
>  File "C:\Python27\lib\site-packages\jpype\_core.py", line 44, in startJVM
>    _jpype.startup(jvm, tuple(args), True)
>RuntimeError: Unable to load DLL [C:\Program Files\Java\jre7\bin\client\jvm.dll], error = >Não foi possível encontrar o módulo especificado.
> at src/native/common/include\jp_platform_win32.h:58

我已经检查了 JVM 和 JRE,它们已正确安装并设置了JAVA_HOME环境变量。

有人知道如何解决吗?

4

0 回答 0