Skip to main content

Scrape article metadata and comments from DER SPIEGEL

Project description



Scrape articles and comments from DER SPIEGEL


pip install spiegel-scraper


from datetime import date
import spiegel_scraper as spon

# list all articles from 2020-01-31
archive_entries = spon.archive.by_date(date(2020, 1, 31))
# or, for later replication, retrieve and scrape the html instead
archive_html = spon.archive.html_by_date(date(2020, 1, 31))
archive_entries_from_html = spon.archive.scrape_html(archive_html)

# fetch one article by url
article_url = archive_entries[0]['url']
article = spon.article.by_url(article_url)
# or alternatively using the html
article_html = spon.article.html_by_url(article_url)
article_from_html = spon.article.scrape_html(article_html)

# retrieve all comments for an article
comments = spon.comments.by_article_id(article['id'])

Project details

Download files

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

Files for spiegel-scraper, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size spiegel_scraper-1.1.1-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size spiegel-scraper-1.1.1.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page