Last active
January 10, 2021 20:18
-
-
Save Galina-Blokh/5457feb40ba41bfaac266b642599cf4d to your computer and use it in GitHub Desktop.
Data search in each response with bs4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for res in response: | |
try: | |
soup = BeautifulSoup(res.content, 'html.parser') | |
except AttributeError: | |
continue | |
recipe_ingredients_lines = soup.find_all(attrs={'class': ['wprm-recipe-ingredient', | |
'ingredient']}) | |
recipe_instructions_lines = soup.find_all(attrs={'class': ['wprm-recipe-instruction-text', | |
'instruction']}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment