Skip to main content

Python package, scraping recipes from all over the internet

Project description

Github Version PyPI - Python Version Downloads GitHub Actions Unittests Coveralls License

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.

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:

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!

https://contrib.rocks/image?repo=hhursev/recipe-scrapers

Share Your Project

Have an idea for using recipe-scrapers? Check out our project ideas wall for inspiration or to share your own project!

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

recipe_scrapers-15.4.0.tar.gz (116.0 kB view details)

Uploaded Source

Built Distribution

recipe_scrapers-15.4.0-py3-none-any.whl (248.2 kB view details)

Uploaded Python 3

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

Hashes for recipe_scrapers-15.4.0.tar.gz
Algorithm Hash digest
SHA256 1587016ce651d259bd51ef693277e7584720ce380ebea6a5bf526094f9fe99f7
MD5 4820e4ad64be6b8657683812409687d1
BLAKE2b-256 1b3ccc31f1c747deca21f8f110a50cc51c645c29552d99903df430f798cd13b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for recipe_scrapers-15.4.0.tar.gz:

Publisher: publish.yaml on hhursev/recipe-scrapers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file recipe_scrapers-15.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for recipe_scrapers-15.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58d3d60e19d91f43c540496e942bfb4ca244e0de02fe2156edd552226477634f
MD5 d042658ebe0e634947bde46b6a0975bc
BLAKE2b-256 a2637b6047a2fb3e9cd217b384fc957fcb03525012dd47c6c783a6aa310cc8db

See more details on using hashes here.

Provenance

The following attestation bundles were made for recipe_scrapers-15.4.0-py3-none-any.whl:

Publisher: publish.yaml on hhursev/recipe-scrapers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page