Easy to build html parsers
Project description
Soupstars
Soupstars makes it easy to build website parsers.
from soupstars import HttpBaseRecipe, ingredient
class FacebookRecipe(HttpBaseRecipe):
@ingredient
def title(self):
return self.read().find('h2').text.strip()
fb = FacebookRecipe("https://www.facebook.com")
print(fb['title'])
# Connect with friends and the world around you
Install with pip.
pip install soupstars
There's a few prebuilt parsers, but they're not necessary maintained.
>> from soupstars.recipes.nytimes import NytimesArticleRecipe
>> article_url = "https://www.nytimes.com/2019/01/07/us/politics/trump-address-border-visit.html"
>> article = NytimesArticleRecipe(article_url)
>> article.json()
{
"authors": "\"By Maggie Haberman, Michael M. Grynbaum and Eileen Sullivan\"",
"published_at": "\"Jan. 7, 2019\"",
"title": "\"Trump Wants to Deliver Prime-Time Address on Government Shutdown and Will Visit the Border\""
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
soupstars-0.1.0.tar.gz
(3.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soupstars-0.1.0.tar.gz.
File metadata
- Download URL: soupstars-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.2+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75e6c047317a0b12aedda6fa313e5cb0fb44abf016aa857ceea4da6be93b9564
|
|
| MD5 |
34bbab310b97d21c8341e7a2d18c54eb
|
|
| BLAKE2b-256 |
b2141a1c9f5cb37ff249a57b28e1489423ad7cf12652e205d753771f4af5a757
|
File details
Details for the file soupstars-0.1.0-py3-none-any.whl.
File metadata
- Download URL: soupstars-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/2.7.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e844dd9c22acf7fd341a05aff5f89c50c7a24431f679b66fafebcd600de9e529
|
|
| MD5 |
7b223722ad7441bf9eaf68b957aa3b36
|
|
| BLAKE2b-256 |
8d323df4fb925a426ced7dcbcd5120b7e67d2f731d53f0ab200a455a4493bea6
|