diff --git a/pages/en/Pars_EN.md b/pages/en/Pars_EN.md index ad4096a..be9e384 100644 --- a/pages/en/Pars_EN.md +++ b/pages/en/Pars_EN.md @@ -55,6 +55,11 @@ nameFolder = 'img' # The first results are what we wanted, and the rest are not. Therefore, we prefer to get the first 84 elements locator = 'b_NgmZrVnRtV8MZMEjLs' allCards = soup.find_all(class_=locator)[:84] + if len(allCards) == 0: + print(f'''Something went wrong. Here is a list of possible causes: + 1) DuckDuckGo has changed the class for video cards. The code uses the locator "{locator}" + 2) The site did not load. Try increasing the timeSleep parameter or make a request later.''') + return # Getting all images allImg = [card.find('img') for card in allCards] diff --git a/pages/ru/Pars_RU.md b/pages/ru/Pars_RU.md index f297e5c..21bce3d 100644 --- a/pages/ru/Pars_RU.md +++ b/pages/ru/Pars_RU.md @@ -60,9 +60,9 @@ def main(): locator = 'b_NgmZrVnRtV8MZMEjLs' allCards = soup.find_all(class_=locator)[:84] if len(allCards) == 0: - print(f'''Something went wrong. Here is a list of possible causes: - 1) DuckDuckGo has changed the class for video cards. The code uses the locator "{locator}" - 2) The site did not load. Try increasing the timeSleep parameter or make a request later.''') + print(f'''Что-то пошло не так. Вот список возможных проблем: + 1) DuckDuckGo изменил назввание класса для карточек с видео. Сейчас используется локатор: "{locator}" + 2) Сайт не прогрузился. Попробуй увиличить значени параметра timeSleep или выполни запрос позже.''') return # Получаем все изображения