Skip to main content

A scraper for recipe website

Project description

# Recipe Collector This library will try to scrape recipe websites and get the information of the recipe. This work on a majority of websites. Give an url to the scraper and get back an instance of the Recipe() class with all the information about the recipe (if it was found).

## Usage ### Install the library ` pip install recipeGetter `

### Scrape the recipe `python recipe = RecipeScraper(url) infos = recipe.scrape() # Informations available for the recipe infos.name # The name of the recipe infos.author # The name of the author of the recipe infos.description # Description of the recipe infos.yeild # Number of yeild that the recipe give infos.category # The category of the recipe infos.ingredients # Ingredients used in the recipe infos.instructions # Instructions used in the recipe infos.prep_time # Preping time of the recipe infos.cook_time # Cooking time of the recipe infos.image # A link to an image of the recipe `

Some informations may not be present if the scraper was not succesful to find it or if the information was not present on the website.

## How it works ### Trivial case A majority of popular recipe websites put data about the recipe in a <script type=”application/ld+json”> tag. They put it there because Google will improve the searching result if a website use this technique. The data is very easily pared and returned as a RecipeTrivial() instance.

### Complex case When a website is not putting it’s data in a script tag, the library will search the arbitrary html for the informations. Not all the data is accessible with this technique and only the ingredients, instructions, name of the recipe, description and author will be searched.

## License [License](https://github.com/xavierhamel/recipeGetter/blob/main/LICENSE)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recipeGetter-0.0.3.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file recipeGetter-0.0.3.tar.gz.

File metadata

  • Download URL: recipeGetter-0.0.3.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0

File hashes

Hashes for recipeGetter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 15297a24d37a2c189134a393b976523a21e696d0045668969dee763df935a28c
MD5 c3eb75e57da28575601de7068d51164c
BLAKE2b-256 278bda796d550dd5946bdb0c673193212a92d995d37453402c7e25292762576c

See more details on using hashes here.

Supported by

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