diff --git a/recipe.py b/recipe.py index 8405d12..0c1da97 100644 --- a/recipe.py +++ b/recipe.py @@ -9,6 +9,7 @@ def get_recipe_from_xiachufang(url): response.raise_for_status() soup = bs4.BeautifulSoup(response.text, 'html.parser') name = soup.find('h1', class_='page-title').text.strip() + name = name.split('的')[-1] ingredients = [] for ingredient in soup.find('div', class_='ings').find('table').find_all('tr'): ingredients.append(' / '.join([td.text.strip() for td in ingredient.find_all('td')]))