Skip to content

readability

2,675 5 39 Apache-2.0
0.8.1 (4 Jul 2020) Jun 30 2011 308.7 thousand (month)

python-readability is a python package that allows developers to extract the main content of a web page, removing any unnecessary or unwanted elements, such as ads, navigation, and sidebars.

It is based on the algorithm used by the popular web-based service, Readability, and it uses the beautifulsoup4 package to parse the HTML and extract the main content.

Readability is similar to Newspaper in terms that it's extracting HTML data

Example Use


import requests
from readability import document

response = requests.get('http://example.com')
doc = document(response.content)
doc.title()
'example domain'

doc.summary()
"""<html><body><div><body id="readabilitybody">\n<div>\n    <h1>example domain</h1>\n
<p>this domain is established to be used for illustrative examples in documents. you may
use this\n    domain in examples without prior coordination or asking for permission.</p>
\n    <p><a href="http://www.iana.org/domains/example">more information...</a></p>\n</div>
\n</body>\n</div></body></html>"""

Alternatives / Similar


1,860 2024.2.26 (9 months ago) Dec 14 2008 compare
3,703 2.0.0 (6 days ago) Jul 17 2019 compare
14,204 0.2.8 (6 years ago) Dec 28 2012 compare
859 0.18.0 (a month ago) Oct 27 2015 compare
3,533 0.11.0 (2 years ago) Oct 20 2013 compare
246 2.0.7 (2 years ago) Dec 11 2020 compare
11,112 1.1.9 (6 years ago) Aug 24 2018 compare

Other Languages

2,565 v1.3.0 (9 months ago) Apr 20 2016 compare
Was this page helpful?