Skip to main content

Simplified python article discovery & extraction.

Project description

Inspired by requests for its simplicity and powered by lxml for its speed; newspaper is a Python 2 library for extracting & curating articles from the web.

Newspaper wants to change the way people handle article extraction with a new, more precise layer of abstraction. Newspaper caches whatever it can for speed. Also, everything is in unicode

Please refer to The Documentation for a quickstart tutorial!

A Glance:

>>> import newspaper

>>> cnn_paper ='')

>>> for article in cnn_paper.articles:
>>>     print article.url

>>> for category in cnn_paper.category_urls():
>>>     print category

>>> article = cnn_paper.articles[0]

>>> article.html
u'<!DOCTYPE HTML><html itemscope itemtype="http://...'
>>> article.parse()

>>> article.authors
[u'Leigh Ann Caldwell', 'John Honway']

>>> article.text
u'Washington (CNN) -- Not everyone subscribes to a New Year's resolution...'
>>> article.nlp()

>>> article.keywords
['New Years', 'resolution', ...]

>>> article.summary
u'The study shows that 93% of people ...'


Check out The Documentation for full and detailed guides using newspaper.


  • News url identification

  • Text extraction from html

  • Keyword extraction from text

  • Summary extraction from text

  • Author extraction from text

  • Top image extraction from html

  • All image extraction from html

  • Multi-threaded article download framework

  • Google trending terms extraction

Get it now

$ pip install newspaper

If you know for sure that you'll use the natural language features,
nlp(), you must download some separate nltk corpora below.
You must download everything in python 2.6 - 2.7!

$ curl | python2.7

Todo List

  • Add a “follow_robots.txt” option in the config object.

  • Bake in the CSSSelect and BeautifulSoup dependencies

0.0.4 - Fully integrated python-goose library into newspaper. Article objects

now have much more options. All configurations are now based on Configuration() objects which can be passed into Source or Article objects. Default configuration setups make this easy. Added simple multithreading article download framework.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newspaper-0.0.4.tar.gz (6.7 MB view hashes)

Uploaded source

Built Distribution

newspaper-0.0.4.macosx-10.8-intel.exe (6.9 MB view hashes)

Uploaded any

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page