Naive parser for the Drudge Report
Project description
A pretty simple parser for Drudge Report. I find the site impossible to look at and wanted a way to more easily digest the information, as I like to keep tabs on lots of differing news outlets.
This library has no external dependencies and supports Python 2.7+ (targeted for Python 3+)
Installation
PyPI
pip install drudge_parser
Usage
Example:
import drudge_parser # You can use and feed the parser directly if you would like: parser = drudge_parser.DrudgeParser() parser.feed('<html string>') print(parser.articles) # Or just use the helper to scrape the current site: articles = drudge_parser.scrape_page() print(articles)
Articles is a list of article groupings. These are ordered down the page, so they will always be TOP_STORY, MAIN_HEADLINE, followed by COLUMN{1,3}.
An article grouping looks like:
{ "images": [str], # This often is just empty, never None "articles": [ # These will be ordered by appearance, in some cases drudge # builds related titles on each other to make one link across # multiple lines. { "title": str, "href": str } ], # Never None "location": str # One of the drudge_parser.Location 'enumeration' }
Additional Contributors
[jamesjackson69](https://github.com/jamesjackson69)
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
drudge_parser-3.0.2.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for drudge_parser-3.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fce6e6b1dff4787396bfe15314dc5b8ae2233a60eea3f85a2a7ccda87edf7a38 |
|
MD5 | 167d594084e833f0a12a1ad0c776f519 |
|
BLAKE2b-256 | 9d0404b1fbfd4b63ee1d882468e13181110287b07d6d814d942a8d1d51b58aa8 |