Exemple #1
0
def load_recipes_from_path(recipes_path = 'test'):
    recipes = []
    for (path, dirs, files) in os.walk(os.path.join(os.getcwd(), recipes_path)):
        for fp in files:
            print fp
            with open(os.path.join(path, fp)) as f:
                soup = BeautifulSoup(f.read())
                recipes.append(RecipeImport.parse_soup_epicurious(soup))
    return recipes
Exemple #2
0
#!/usr/bin/env python
from BeautifulSoup import BeautifulSoup
import RecipeImport
f = open('Chicken-and-Cheese-Sliders-366309')
soup = BeautifulSoup(f.read())
f.close()

print RecipeImport.parse_soup_epicurious(soup).prettify()