Python package, scraping recipes from all over the internet
Project description
A reliable python tool for scraping recipe data from popular cooking websites. Extract structured recipe information including ingredients, instructions, cooking times, and nutritional data with ease. Supports 400+ major recipe websites out of the box.
Quick Links
Installing
pip install recipe-scrapers
Basic Usage
from urllib.request import urlopen
from recipe_scrapers import scrape_html
# Example recipe URL
url = "https://www.allrecipes.com/recipe/158968/spinach-and-feta-turkey-burgers/"
# retrieve the recipe webpage HTML
html = urlopen(url).read().decode("utf-8")
# pass the html alongside the url to our scrape_html function
scraper = scrape_html(html, org_url=url)
# Extract recipe information
print(scraper.title()) # "Spinach and Feta Turkey Burgers"
print(scraper.total_time()) # 35
print(scraper.yields()) # "4 servings"
print(scraper.ingredients()) # ['1 pound ground turkey', '1 cup fresh spinach...']
print(scraper.instructions()) # 'Step 1: In a large bowl...'
# For a complete list of available methods:
help(scraper)
HTTP Clients
Some Python HTTP clients you can use to retrieve HTML include:
requests: Popular and feature-rich
httpx: Modern, supports async/await
urllib.request: Included in Python’s standard library
Please refer to their documentation to find out what options (timeout configuration, proxy support, etc) are available.
Supported Sites
We support a wide range of recipe websites out of the box. Check our supported sites list for the full list.
You can also get the full list programmatically with:
from recipe_scrapers import SCRAPERS
SCRAPERS.keys()
Documentation
For detailed usage instructions, examples, and API reference, visit our documentation.
Contributing
We welcome contributions! Please read our contribution guide to get started.
Special Thanks
To all the contributors who help make this project better!
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
Built Distribution
File details
Details for the file recipe_scrapers-15.4.0.tar.gz
.
File metadata
- Download URL: recipe_scrapers-15.4.0.tar.gz
- Upload date:
- Size: 116.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1587016ce651d259bd51ef693277e7584720ce380ebea6a5bf526094f9fe99f7 |
|
MD5 | 4820e4ad64be6b8657683812409687d1 |
|
BLAKE2b-256 | 1b3ccc31f1c747deca21f8f110a50cc51c645c29552d99903df430f798cd13b8 |
Provenance
The following attestation bundles were made for recipe_scrapers-15.4.0.tar.gz
:
Publisher:
publish.yaml
on hhursev/recipe-scrapers
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
recipe_scrapers-15.4.0.tar.gz
- Subject digest:
1587016ce651d259bd51ef693277e7584720ce380ebea6a5bf526094f9fe99f7
- Sigstore transparency entry: 162354778
- Sigstore integration time:
- Permalink:
hhursev/recipe-scrapers@371a663be17a39ebd48d12b90a1f44584e4fb074
- Branch / Tag:
refs/tags/15.4.0
- Owner: https://github.com/hhursev
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@371a663be17a39ebd48d12b90a1f44584e4fb074
- Trigger Event:
release
- Statement type:
File details
Details for the file recipe_scrapers-15.4.0-py3-none-any.whl
.
File metadata
- Download URL: recipe_scrapers-15.4.0-py3-none-any.whl
- Upload date:
- Size: 248.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d3d60e19d91f43c540496e942bfb4ca244e0de02fe2156edd552226477634f |
|
MD5 | d042658ebe0e634947bde46b6a0975bc |
|
BLAKE2b-256 | a2637b6047a2fb3e9cd217b384fc957fcb03525012dd47c6c783a6aa310cc8db |
Provenance
The following attestation bundles were made for recipe_scrapers-15.4.0-py3-none-any.whl
:
Publisher:
publish.yaml
on hhursev/recipe-scrapers
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
recipe_scrapers-15.4.0-py3-none-any.whl
- Subject digest:
58d3d60e19d91f43c540496e942bfb4ca244e0de02fe2156edd552226477634f
- Sigstore transparency entry: 162354780
- Sigstore integration time:
- Permalink:
hhursev/recipe-scrapers@371a663be17a39ebd48d12b90a1f44584e4fb074
- Branch / Tag:
refs/tags/15.4.0
- Owner: https://github.com/hhursev
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
publish.yaml@371a663be17a39ebd48d12b90a1f44584e4fb074
- Trigger Event:
release
- Statement type: