From b38fc000728e123c7b4dde7ffc138c5bb1f8224f Mon Sep 17 00:00:00 2001 From: Ching Date: Fri, 8 Mar 2024 17:21:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(recipe):=20=E8=8E=B7=E5=8F=96=E8=8F=9C?= =?UTF-8?q?=E8=B0=B1=E6=97=B6=E5=88=A0=E9=99=A4=E6=B2=A1=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=BD=A2=E5=AE=B9=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recipe.py | 1 + 1 file changed, 1 insertion(+) 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')]))