readability-lxml Documentation

repository·master·Indexed 25 days ago

https://github.com/buriy/python-readability

A fast HTML to text parser and article readability tool for Python 3, ported from the arc90 Readability project. It provides the Document class to extract and clean the main body text and title from HTML documents.

Tokens
158
Snippets
1
Records
2
Agent score
34%

What's inside readability-lxml

  1. Extract title and main body text using the Document class

    master
    To extract the main content and title from an HTML document, import the Document class from readability. Pass the raw HTML content (e.g., from a requests response) to the Document constructor. Use .title() to retrieve the article title and .summary() to retrieve the cleaned HTML content of the main body.