Сбор и сохранение рецептом и ссылок в json

This commit is contained in:
zein
2025-11-23 04:09:34 +03:00
parent cbb56871e8
commit 80eab4e9bd
3 changed files with 77 additions and 23 deletions

View File

@@ -19,7 +19,8 @@ def try_request(link, max_retries=5):
retries += 1
def try_soup(response):
try: return bs(response.text, 'html.parser')
try:
return bs(response.text, 'html.parser')
except:
print('404')
return False
@@ -119,7 +120,6 @@ def extr_steps(main_container):
# Если класс detailed_step_description_big noPhotoStep, то ищем через get_text. Сейчас title пустой, тк его нет на странице
if title is None:
title = items.get_text() #Теперь тайтл заполнен
print(title)
steps.append({
'img': img,