Program jusText is a tool for removing boilerplate content, such as navigation links, headers, and footers from HTML pages. It is designed to preserve mainly text containing full sentences and it is therefore well suited for creating linguistic resources such as Web corpora. You can try it online.
This is a fork of original (currently unmaintained) code of jusText hosted on Google Code. Below are some alternatives that I found:
- http://code.google.com/p/boilerpipe/
- http://sourceforge.net/projects/webascorpus/?source=navbar
- https://github.com/jiminoc/goose
- https://github.com/grangier/python-goose
- https://github.com/miso-belica/readability.py
- https://github.com/dcramer/decruft
- https://github.com/FeiSun/ContentExtraction
- https://github.com/JalfResi/justext
- https://github.com/andreypopp/extracty/tree/master/justext
- https://github.com/dreamindustries/jaws/tree/master/justext
- https://github.com/says/justext
- https://github.com/chbrown/justext
- https://github.com/says/justext-app
Make sure you have Python 2.6+/3.2+ and pip (Windows, Linux) installed. Run simply (preferred way):
$ [sudo] pip install justext
Or for the fresh version:
$ [sudo] pip install git+git://github.com/miso-belica/jusText.git
Or if you have to:
$ wget https://github.com/miso-belica/jusText/archive/master.zip # download the sources
$ unzip master.zip # extract the downloaded file
$ jusText-master/
$ [sudo] python setup.py install # install the package
lxml>=2.2.4
$ python -m justext -s Czech -o text.txt http://www.zdrojak.cz/clanky/automaticke-zabezpeceni/
$ python -m justext -s English -o plain_text.txt english_page.html
$ python -m justext --help # for more info
import requests
import justext
response = requests.get("http://planet.python.org/")
paragraphs = justext.justext(response.content, justext.get_stoplist("English"))
for paragraph in paragraphs:
if not paragraph.is_boilerplate:
print paragraph.text
Run tests via
$ nosetests tests
This software has been developed at the Natural Language Processing Centre of Masaryk University in Brno with a financial support from PRESEMT and Lexical Computing Ltd. It also relates to PhD research of Jan Pomikálek.