0

I successfully installed JPype and Boilerpipe Python wrapper.

My JAVA_HOME path is correct (as far as I know).

I created a python file with the following code:

from boilerpipe.extract import Extractor

extractor = Extractor(extractor='ArticleExtractor', url='http://edition.cnn.com/2016/02/09/politics/new-hampshire-primary-highlights/')

extracted_text = extractor.getText()

print(extracted_text)

I am getting this error when I run python3 boiler_test.py

Traceback (most recent call last):
  File "boiler_test.py", line 1, in <module>
    from boilerpipe.extract import Extractor
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/boilerpipe/extract/__init__.py", line 2, in <module> import urllib2
ImportError: No module named 'urllib2'

How can I solve this?

Thank you.

Daniel
  • 1
  • 2
  • 1
    That module must not be python 3 compatible. Can you use 2.7? see [here](http://stackoverflow.com/questions/6594620/python-3-2-unable-to-import-urllib2-importerror-no-module-named-urllib2) – Paul Rooney Feb 10 '16 at 05:43
  • Oh~ Is it? thanks. ^^ – Daniel Feb 10 '16 at 05:45

0 Answers0