Examples
Warning
recipe-scrapers
is designed to focus exclusively on HTML parsing.
This core principle guides our development and support. You'll need to implement your own solution for fetching recipe HTMLs and managing network requests. The library works best when you provide both the HTML content and its source domain.
HTTP Clients
Some Python HTTP clients you can use to retrieve HTML include:
- requests: Popular and feature-rich
- httpx: A fully featured HTTP client for Python 3,
- aiohttp: Asynchronous HTTP Client/Server
- urllib.request: Included in Python's standard library
Please refer to their documentation to find out what options (headers, timeout configuration, proxy support, etc) are available.
We use the built-in urllib.requests in our examples and assume HTML has been fetched successfully.
Usage
Example of how to use the library:
For optimal results, always provide both the HTML content and its original URL. This helps the library correctly parse website-specific elements.
Available Methods
Recipe websites vary in the amount of information they provide. While some offer
comprehensive details like nutritional information (.nutrients()
), others may
not.
Core Methods
These methods are available for all the supported websites:
Under Construction
This documentation section is currently being updated and improved.
Optional Methods
These additional methods are available for some websites:
Under Construction
This documentation section is currently being updated and improved.
Common Patterns
Under Construction
This documentation section is currently being updated and improved.