Сбор и сохранение рецептом и ссылок в json
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user