How to use Python newspaper library? -
i'm trying make web parser , saved it. had found newspaper library. i'm using eclipse. couldn't result. please me.
import newspaper cnn_paper = newspaper.build('http://cnn.com') article in cnn_paper.articles: print(article.url)
this error message:
traceback (most recent call last): file "d:\workspace2\jeselasearchsys\nespaperscraper_01.py", line 2, in <module> import newspaper file "c:\python27\lib\site-packages\newspaper3k-0.1.5-py2.7.egg\newspaper\__init__.py", line 10, n <module> .article import article, articleexception file "c:\python27\lib\site-packages\newspaper3k-0.1.5-py2.7.egg\newspaper\article.py", line 12, in <module> . import images file "c:\python27\lib\site-packages\newspaper3k-0.1.5-py2.7.egg\newspaper\images.py", line 15, in <module> import urllib.request importerror: no module named request
there nothing wrong code. need install or locate newspaper
, request
libraries. seems newspaper
/ request
library missing on development machine.
$ pip install newspaper $ pip install urllib3
command above install it.
Comments
Post a Comment