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 , requestlibraries. seems newspaper / request library missing on development machine.

$ pip install newspaper $ pip install urllib3 

command above install it.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -