ExamplesΒΆ

Soupstars includes various examples that you can reference or use directly.

NYTimesΒΆ

Extract article links and article metadata from nytimes.com

class soupstars.examples.nytimes.NytimesArticleParser(url)[source]ΒΆ

Parse attributes from a NY times article.

>>> from soupstars.examples.nytimes import NytimesArticleParser
title()[source]ΒΆ

The title of the article.

author()[source]ΒΆ

The author(s) of the article.

class soupstars.examples.nytimes.NytimesLinkParser(url)[source]ΒΆ

Parse the links from a NY times webpage.

Parameters:url (str) – The webpage to parse
>>> from soupstars.examples.nytimes import NytimesLinkParser

A list of links that point to NYTimes articles

non_article_links()[source]ΒΆ

A list of links that points to NYTimes pages that are not articles.

EconomistΒΆ

Extract metadata from economist index and article pages

class soupstars.examples.economist.WeeklyIndexPages(**kwargs)[source]ΒΆ

Example model for storing the results of the parser

class soupstars.examples.economist.WeeklyIndexPageParser(url)[source]ΒΆ

Parse metadata from the weekly updated index pages

ModelΒΆ

alias of WeeklyIndexPages

base_url()[source]ΒΆ

The url used

article_date()[source]ΒΆ

The date of the article

status_code()[source]ΒΆ

Status code of the request

num_articles()[source]ΒΆ

The number of articles foudn on the page