All Projects → benawad → Food_network_wrapper

benawad / Food_network_wrapper

Licence: mit
Search and scrape recipes from http://foodnetwork.com

Programming Languages

python
139335 projects - #7 most used programming language

food_network_wrapper

Build Status Coverage Status PyPI Python Versions

Search your favorite recipes from Food Network and then scrape their contents.

Installation

pip install food_network_wrapper

Usage

import methods

from food_network_wrapper import recipe_search, get_n_recipes, scrape_recipe

Search recipes

rthumbnails = recipe_search("pad thai")

Returns up to 10 RThumbnail objects in a list

To get more recipes you have to increment the page parameter

rthumbnails = recipe_search("pad thai", page=2)

Or you can use the shortcut method

rthumbnails = get_n_recipes("pad thai", n=31) 

Scrape a recipe

recipe = scrape_recipe("http://www.foodnetwork.com/recipes/food-network-kitchens/grape-jelly-breakfast-tarts-recipe.html")

Use search and scrape together

rthumbnails = get_n_recipes("pad thai", n=31) 
recipes = []
for i in rthumbnails:
   recipe = scrape_recipe(i.url) 
   recipes.append(recipe)

For more examples check out demo.py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].