Giter Club home page Giter Club logo

parser_avito's Introduction

Avito Parser

Находит объявления на avito.ru по ключевым словам. Присылает уведомления в telegram и сохраняет результат в csv файл.

Другие парсеры Авито

Также есть бесплатные парсеры Авито от других разработчиков: https://dialoss.github.io/avito/

Обновление, версия 1.09

Добавлено

  • Фильтрация по гео. Если по Вашей ссылке мало объявлений, Авито добавит предложения из других регионов, что нам обычно не нужно. Скрипт будет проверять вхождение "Вашего адреса" в адрес в объявлении (пример: входит ли "краснодар" в "Краснодар ул. Авитолога 69", регистр здесь не важен), если не входит - уведомление не придет и в результаты это тоже не запишется. Данная опция не обязательна к заполнению.
  • Добавлена кнопка удаления текущего адреса, это удобно т.к. адреса длинные
  • Режим отладки: в данном режиме Вы будете видеть окно браузера. Полезно, чтобы понять, что идет не так
  • Разрешено изменение размеров окна
  • Обнаружения бана по IP при загрузке основной страницы (раньше только на отдельной странице объявления)
  • Другие мелкие доработки

Исправлено

  • Проблемы с отображением окна парсера, протестировано на Linux Mint и Windows 10
  • Ошибки связанные с кодировками
  • Ошибка при загрузке скрипта, если url был с русскими буквами и был внесен вручную в settings.ini
  • Ошибка при нажатии на кнопку "Стоп"
  • Скрипт иногда не видел кнопку "Далее"
  • Другие мелкие баги

Дополнительно

Очень Важно!!! устанавливать seleniumbase именно такой версии seleniumbase==4.16.2. Я знаю, что есть версия посвежее, но в ней есть баг, он связан с работой драйвера при переключении вкладок. Я в ближайшее время заведу issue на сайте разработчика, но там совсем непонятно чей именно это баг: seleniumbase, selenium, undetected_chromedriver или chrome, всё слишком завязано друг на друга.

Если Вы хотите, чтобы Avito Parser дальше развивался и оставался бесплатным - поддержите проект, на голом энтузиазме далеко не уедешь. Заранее спасибо! Поддержать можно по ссылке: https://yoomoney.ru/to/410014382689862 или простым переводом 2204 1201 0103 5539

Обновление, версия 1.08

  • Исправлена ошибка при работе с Chrome 115, обновите зависимости. При установке зависимостей используйте виртуальное окружение

Обновление, версия 1.07

  • Исправлены ошибки касательно минимальной и максимальной цены при запуске без графического интерфейса

Добавлено:

  • Новый графический интерфейс, теперь всё стало выглядеть более современно. Спасибо https://github.com/Genone22. Не забудьте обновить зависимости

Обновление, версия 1.06

Исправлены ошибки:

  • Дублирование объявления при отправке в telegram, если Вы нажимали кнопку test
  • Иногда не отправлялись логи в telegram, хотя данные были заполнены и кнопка test работала
  • Определение версии установленного браузера теперь переложена на Seleniumbase
  • Кодировки

Добавлено:

  • Переход на Seleniumbase (не забудьте обновить зависимости)
  • Ускорена работа
  • Улучшена стабильность
  • Проверка keywords теперь работает и для названия объявления (ранее проверялось только описание)
  • Обнаружение бана по IP со стороны Авито

Обновление, версия 1.05

Исправлены ошибки:

  • Ошибка при попытке прочитать описание (selector "[class*='item-description']")
  • Дублирование объявления при отправке в telegram
  • Иногда не работала кнопка test (тестирование отправки сообщений в telegram) без перезапуска скрипта
  • Другие мелкие баги

Добавлено:

  • С сайта парсится теперь больше информации: "Название", "Цена", "Ссылка", "Описание", "Просмотров", "Дата публикации", "Продавец"

  • Результат сохраняется в csv файл в папке result (более удобно работать)

  • Браузер использует случайный юзер-агент из файла user_agent_pc.txt, можете добавить большее количество самостоятельно (но это необязательно)

  • Сильно улучшена стабильность работы

  • Оставлена возможность запуска скрипта без графического интерфейса, все настройки задаются в файле settings.ini

  • Увеличено максимальное количество уже просмотренных сообщений до 5000 (хранится в файле viewed.txt и очищается автоматически при достижении лимита)

  • Увеличено окно вывода результата и переделан сам вывод

Обновление, версия 1.02

  • Исправлены старые ошибки и добавлены новые)
  • Добавлено поле минимальная цена, теперь можно указывать верхнюю и нижнюю границу цены
  • Исправлен баг, связанный с отсутствием viewed.txt
  • Улучшена стабильность работы
  • Добавлена возможность запуска скрипта без графического интерфейса, все настройки задаются в файле settings.ini. После нужно запустить parser_cls.py, таким образом, удобно запускать скрипт на удаленном сервере

Обновление, версия 1.01

  • Исправлена ошибка когда на страницы нет кнопки "Далее"
  • Добавлено поле максимальная цена, теперь можно искать не только бесплатные объявления

Youtube (как это работает)

Первая версия (создание самого парсера) https://youtu.be/pbzPkZcVOx0

Вторая версия (обзор нововведений: графический интерфейс, уведомления и как это работает) https://youtu.be/OjId94hYWnc

Установка

Для работы требуется Python 3.5+. Скопируйте проект и установите зависимости:

  pip install -r requirements.txt

У Вас также должен быть установлен браузер Google Chrome любой более менее свежей версии. Скрипт тестировался на версиях 108-112

Запустите AvitoParser.py

  python AvitoParser.py

Если Вам необходимо получать уведомления о новых объявлениях в telegram:

  • Перейдите в диалог с https://t.me/BotFather
  • Введите команду /newbot, придумайте name и username для бота
  • Скопируйте token и вставьте в первое поле скрипта
  • Перейдите в диалог с Вашим ботом по ссылке из прошлого шага, ссылка имеет формат: t.me/your_bot
  • Напишите @get_id_bot и скопируйте chat_id вашего диалога, вставьте его во второе поле данного скрипта
  • При нажатии на кнопку Test в скрипте, Вам должно прийти сообщение. Если нет, перезагрузите скрипт и попробуйте еще раз

Возможности

  • Удобное управление с помощью графического интерфейса
  • Проверка новых объявлений
  • Установка количества проверяемых страниц
  • Установка паузы между повторами
  • Уведомление в telegram как опция, также результат сохраняется в result/keyword*.json и выводится в окно
  • Хранение уже просмотренных объявлений, т.е. дубли игнорируются
  • Присылает только объявление, у которых цена = 0, рекламные объявления отсекаются
  • Установка слов-ключей, которые должны быть в описании объявления
  • Больше не нужно вводить версию Chrome, скрипт сам её определит (работает для Linux и Windows)

Проблемы

При обнаружении ошибок, ждем в https://github.com/Duff89/parser_avito/issues. Пожалуйста, указывайте не только ошибку, но и информацию о Вашей ОС, версии скрипта, тип и версию браузера и способ запуска. Для прямой связи с автором, пишите: [email protected]

Поддержка развития проекта

Ваша поддержка очень важна для дальнейшего и регулярного развития данного скрипта. Поддержать можно по ссылке: https://yoomoney.ru/to/410014382689862 или простым переводом 2204 1201 0103 5539. Заранее спасибо

Если понадобятся хорошие прокси для подобных скриптов, рекомендую: https://proxy6.net/?r=54545 (купон для скидки SdSq8wCwJA)

parser_avito's People

Contributors

duff89 avatar genone22 avatar makarworld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

parser_avito's Issues

При запуске появляется командная строка с ошибкой в ней Неверно задано имя папки. Отказано в доступе.

Что я делал:

  1. Установил python-3.11.4-amd64
  2. Пробросил переменные среды C:\Users\avito\AppData\Local\Programs\Python\Python311\Scripts\
  3. Установил библиотеку pip install undetected-chromedriver
  4. Установил все зависимости ​C:\Users\avito\AppData\Local\Programs\Python\Python311\python.exe -m pip install -r C:\Users\avito\Desktop\parser_avito-master\requirements.txt
  5. При запуске программы C:\Users\avito\Desktop\parser_avito-master\AvitoParser.py
    Получаю ошибку:
    Неверно задано имя папки.
    c:\progra ~ 1\common~1\system\symsrv.dll.000
    Отказано в доступе.

    И в папке с программой появилась папка с файлами
    C:\Users\avito\Desktop\parser_avito-master_pycache_\locator.cpython-311.pyc
    C:\Users\avito\Desktop\parser_avito-master_pycache_\parser_cls.cpython-311.pyc

Есть ли возможность запустить это на Win 7 x64?

Ошибка https://www.python.org/ftp/python/3.11.4/python-3.11.4-amd64.exe
Ошибка настройки
Одна или несколько проблем привели к сбою настройки. Пожалуйста, устраните неполадки, а затем повторите попытку настройки. Для получения дополнительной информации смотрите файл журнала.
Для установки Python 3.11.4 (64-разрядная версия) требуется как минимум Windows 8.1 или Windows Server 2012
Визит python.org чтобы загрузить более раннюю версию Python.

Ошибка An error has been caught in function '__paginator'

После нажатия кнопки "Старт" происходит ошибка, при этом обычно 1-2 объявления по запросу выдает.
Прилагаю:

`2023-06-18 20:12:45.482 | ERROR | parser_cls:__paginator:79 - An error has been caught in function '__paginator', process 'MainProcess' (6476), thread 'Thread-2 (start_scraping)' (6884):
Traceback (most recent call last):

File "C:\Users\CTPAHHIK\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 995, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x00000254CB59E0C0>
└ <Thread(Thread-2 (start_scraping), started 6884)>
File "C:\Users\CTPAHHIK\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
│ └ <function Thread.run at 0x00000254CB59DDA0>
└ <Thread(Thread-2 (start_scraping), started 6884)>
File "C:\Users\CTPAHHIK\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <Thread(Thread-2 (start_scraping), started 6884)>
│ │ │ └ ()
│ │ └ <Thread(Thread-2 (start_scraping), started 6884)>
│ └ <bound method Window.start_scraping of <main.Window object .>>
└ <Thread(Thread-2 (start_scraping), started 6884)>

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\AvitoParser.py", line 150, in start_scraping
self.run_parse()
│ └ <function Window.run_parse at 0x00000254CED396C0>
└ <main.Window object .>

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\AvitoParser.py", line 255, in run_parse
).parse()

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\parser_cls.py", line 252, in parse
self.__paginator()
└ <parser_cls.AvitoParse object at 0x00000254CED4B550>

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\parser_cls.py", line 79, in __paginator
self.__parse_page()
└ <parser_cls.AvitoParse object at 0x00000254CED4B550>

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\parser_cls.py", line 126, in __parse_page
self.__save_data(data=data)
│ └ {'name': 'ВАЗ (LADA) 2110, 2005', 'description': 'Доставка автомобилей в другие регионы, до границ Днр и Лнр бесплатно, уточн...
└ <parser_cls.AvitoParse object at 0x00000254CED4B550>

File "C:\Users\CTPAHHIK\Desktop\parser_avito-master\parser_cls.py", line 189, in __save_data
writer.writerow([
│ └ <method 'writerow' of '_csv.writer' objects>
└ <_csv.writer object at 0x00000254CEB4D240>

File "C:\Users\CTPAHHIK\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
│ │ │ │ │ └ <EncodingMap object at 0x00000254CAB82510>
│ │ │ │ └ 'strict'
│ │ │ └ <encodings.cp1251.IncrementalEncoder object at 0x00000254CEDAA290>
│ │ └ '"ВАЗ (LADA) 2110, 2005",135000,https://www.avito.ru/novocherkassk/avtomobili/vaz_lada_2110_2005_2999389184,"Доставка автомоб...
│ └
└ <module 'codecs' (frozen)>

UnicodeEncodeError: 'charmap' codec can't encode character '\u2033' in position 1997: character maps to
2023-06-18 20:12:47.527 | INFO | main:start_scraping:152 - Проверка завершена
2023-06-18 20:12:47.536 | INFO | main:start_scraping:153 - Пауза 5 минут
2023-06-18 20:13:57.574 | INFO | main:stop_scraping:175 - Идет остановка. Пожалуйста, подождите
2023-06-18 20:13:57.700 | INFO | main:start_scraping:160 - Успешно остановлено
`

Реализация User-agent

Реализовать случайные User-agent можно при помощи библиотеки random-user-agent:
pip install random-user-agent

from random_user_agent.params import OperatingSystem, SoftwareName
from random_user_agent.user_agent import UserAgent

...

def __set_up(self):

     '''
     Устанавливаем user-agent
     '''

     software_names = [SoftwareName.CHROME.value]
     operating_systems = [OperatingSystem.WINDOWS.value, OperatingSystem.LINUX.value]

     user_agent_rotator = UserAgent(software_names=software_names, operating_systems=operating_systems, limit=100)
     user_agent = user_agent_rotator.get_random_user_agent()
     options = Options()
     options.add_argument('--headless')
     options.add_argument(f'--user-agent={user_agent}')
     self.driver = uc.Chrome(version_main=self.__get_chrome_version,
                             options=options,
                             )

...

Бан по IP v1.08 + Chrome 115

Все время версия 1.06 стабильно работает с Chrome 114
Версия 1.06 + Chrome 115 работало, но с предупреждением
Если установить 1.08 + Chrome 115 = с первого поиска бан по IP от Авито, просит ввести капчу. Проверил дома два интернета + облако. Причем, даже разгадав капчу через 1,2 поиска опять бан прилетает и потом капча становится вообще не пробиваемая.

Снимок экрана от 2023-07-31 03-50-35
Снимок экрана от 2023-07-31 03-55-49

import customtkinter ModuleNotFoundError: No module named 'customtkinter'

Установил все зависимости через pip, все модули которые выдавали ошибки из-за несовместимости версий - обновил до последних версий, даже этот customtkinter установлен последней версии, но при запуске кода выдает ошибку

Traceback (most recent call last):
File "C:\PythonProject\parser_avito-master\parser_avito-master\AvitoParser.py", line 15, in
import customtkinter
ModuleNotFoundError: No module named 'customtkinter'

Что это может быть?

Добавить телефон

Здравствуйте, парсер отличный! Можете добавить в парсер номер телефона Продавца?

при запуске на armbian не работает

при запуске на armbian не работает хотя я запускаю даже с виртуальной графической оболочкой
root@armbian:~/parser# xvfb-run python3 parser_cls.py
/bin/sh: 1: /usr/local/lib/python3.11/dist-packages/seleniumbase/drivers/chromedriver: Exec format error
/bin/sh: 1: /usr/local/lib/python3.11/dist-packages/seleniumbase/drivers/uc_driver: Exec format error
/bin/sh: 1: /usr/local/lib/python3.11/dist-packages/seleniumbase/drivers/uc_driver: Exec format error
2024-01-21 09:07:47.872 | ERROR | main::313 - [Errno 8] Exec format error: '/usr/local/lib/python3.11/dist-packages/seleniumbase/drivers/uc_driver'
2024-01-21 09:07:48.521 | ERROR | main::314 - Произошла ошибка, но работа будет продолжена через 30 сек. Если ошибка повторится несколько раз - перезапустите скрипт.Если и это не поможет - обратитесь к разработчику по ссылке ниже

при установки requirements ошибка

INFO: pip is looking at multiple versions of seleniumbase to determine which version is compatible with other requirements. This could take a while.
Collecting selenium==4.10.0 (from -r requirements.txt (line 67))
Using cached selenium-4.10.0-py3-none-any.whl (6.7 MB)
Collecting requests==2.31.0 (from -r requirements.txt (line 62))
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
ERROR: Cannot install -r requirements.txt (line 62), -r requirements.txt (line 67), -r requirements.txt (line 68) and certifi==2022.12.7 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested certifi==2022.12.7
requests 2.31.0 depends on certifi>=2017.4.17
selenium 4.10.0 depends on certifi>=2021.10.8
seleniumbase 4.15.3 depends on certifi>=2023.5.7

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

TypeError: expected str, bytes or os.PathLike object, not NoneType

image

Exception in thread Thread-1 (start_scraping):
Traceback (most recent call last):
File "/usr/lib64/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/usr/lib64/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/home/temart/parser_avito/AvitoParser.py", line 152, in start_scraping
self.run_parse()
File "/home/temart/parser_avito/AvitoParser.py", line 258, in run_parse
).parse()
^^^^^^^
File "/home/temart/parser_avito/parser_cls.py", line 236, in parse
with SB(uc=True,
File "/usr/lib64/python3.11/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/plugins/sb_manager.py", line 815, in SB
sb.setUp()
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 13825, in setUp
self.driver = self.get_new_driver(
^^^^^^^^^^^^^^^^^^^^
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 3783, in get_new_driver
new_driver = browser_launcher.get_driver(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 1234, in get_driver
return get_local_driver(
^^^^^^^^^^^^^^^^^
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 3044, in get_local_driver
driver = undetected.Chrome(
^^^^^^^^^^^^^^^^^^
File "/home/temart/parser_avito/env/lib64/python3.11/site-packages/seleniumbase/undetected/init.py", line 294, in init
browser = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib64/python3.11/subprocess.py", line 1824, in _execute_child
and os.path.dirname(executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

Ограничение городов

Мне нужно спарсить с помощью вашего скрипта данные по одному городу - Краснодар.
Я забил ссылку, скрипт стал собирать .csv файл. Но после того как объявления в Краснодаре закончились, он стал парсить другие, сначала соседние типа Сочи и Анапы, потом все дальше и дальше, в конце закончил Кемерово и Красноярском
Можно ли ввести функцию ограничения по городам? Чтобы в других городах просто не искать?

Ошибка при попытке найти класс "item-description" .

Сообщение об ошибке указывает на то, что сценарий столкнулся с ошибкой при попытке найти элемент HTML с помощью Selenium, популярной библиотеки веб-скрейпинга. В частности, ошибка произошла в методе под названием "__paginator", который является частью более крупного класса под названием "AvitoParse".

Сообщение об ошибке содержит обратную трассировку, которая показывает последовательность вызовов функций, приведших к ошибке. Отслеживание показывает, что ошибка произошла на строке 74 класса "AvitoParse" в методе "__paginator". Метод пытается разобрать веб-страницу и извлечь из нее данные, но при попытке найти элемент HTML с классом "item-description" он столкнулся с ошибкой.

Сообщение об ошибке указывает, что метод Selenium "find_element" был вызван на объекте WebElement, но метод "find_element" не смог найти нужный элемент. Это вызвало ошибку "нет такого элемента", которая была поймана кодом обработки ошибок скрипта и записана в журнал.

Чтобы исправить ошибку, автору сценария необходимо просмотреть HTML-структуру соскабливаемой веб-страницы и скорректировать код, чтобы правильно находить нужные элементы. Это может потребовать изменения селектора CSS, используемого для поиска элементов, или изменения способа взаимодействия библиотеки Selenium с веб-страницей.
Сообщение об ошибке указывает на то, что сценарий столкнулся с ошибкой при попытке найти элемент HTML с помощью Selenium, популярной библиотеки веб-скрейпинга. В частности, ошибка произошла в методе под названием "__paginator", который является частью более крупного класса под названием "AvitoParse".

Сообщение об ошибке содержит обратную трассировку, которая показывает последовательность вызовов функций, приведших к ошибке. Отслеживание показывает, что ошибка произошла на строке 74 класса "AvitoParse" в методе "__paginator". Метод пытается разобрать веб-страницу и извлечь из нее данные, но при попытке найти элемент HTML с классом "item-description" он столкнулся с ошибкой.

Сообщение об ошибке указывает, что метод Selenium "find_element" был вызван на объекте WebElement, но метод "find_element" не смог найти нужный элемент. Это вызвало ошибку "нет такого элемента", которая была поймана кодом обработки ошибок скрипта и записана в журнал.

Чтобы исправить ошибку, автору сценария необходимо просмотреть HTML-структуру соскабливаемой веб-страницы и скорректировать код, чтобы правильно находить нужные элементы. Это может потребовать изменения селектора CSS, используемого для поиска элементов, или изменения способа взаимодействия библиотеки Selenium с веб-страницей.

Более подробная ошибка:
self._sink.write(str_record)
File "/usr/local/lib/python3.10/dist-packages/loguru/_simple_sinks.py", line 50, in write
self._handler.handle(record)
File "/usr/lib/python3.10/logging/init.py", line 968, in handle
self.emit(record)
File "/usr/local/lib/python3.10/dist-packages/notifiers/logging.py", line 52, in emit
self.handleError(record)
Message: 'An error has been caught in function '__paginator', process 'MainProcess' (25303), thread 'MainThread' (139769717370880):\nTraceback (most recent call last):\n\n File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 193, in \n ).parse()\n\n File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 156, in parse\n self.__paginator()\n -> <main.AvitoParse object at 0x7f1eabc87a30>\n\n> File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 74, in __paginator\n self.__parse_page()\n -> <main.AvitoParse object at 0x7f1eabc87a30>\n\n File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 96, in __parse_page\n description = title.find_element(LocatorAvito.DESCRIPTIONS).text\n | | | -> ('css selector', "[class='item-description']")\n | | -> <class 'locator.LocatorAvito'>\n | -> <function WebElement.find_element at 0x7f1eab42d240>\n -> <undetected_chromedriver.webelement.WebElement (session="31f83e63e76950e96fd0de1f9ad82d8c", element="087F05A1AE8BAB737E365916...\n\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 426, in find_element\n return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]\n | | | | | -> "[class*='item-description']"\n | | | | -> 'css selector'\n | | | -> 'findChildElement'\n | | -> <class 'selenium.webdriver.remote.command.Command'>\n | -> <function WebElement._execute at 0x7f1eab42d1b0>\n -> <undetected_chromedriver.webelement.WebElement (session="31f83e63e76950e96fd0de1f9ad82d8c", element="087F05A1AE8BAB737E365916...\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 404, in _execute\n return self._parent.execute(command, params)\n | | | | -> {'using': 'css selector', 'value': "[class*='item-description']", 'id': '087F05A1AE8BAB737E365916A8A9BC73_element_57'}\n | | | -> 'findChildElement'\n | | -> <function WebDriver.execute at 0x7f1eab4416c0>\n | -> <undetected_chromedriver.Chrome (session="31f83e63e76950e96fd0de1f9ad82d8c")>\n -> <undetected_chromedriver.webelement.WebElement (session="31f83e63e76950e96fd0de1f9ad82d8c", element="087F05A1AE8BAB737E365916...\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute\n self.error_handler.check_response(response)\n | | | -> {'status': 404, 'value': '{"value":{"error":"no such element","message":"no such element: Unable to locate element: {\\"metho...\n | | -> <function ErrorHandler.check_response at 0x7f1eab624a60>\n | -> <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f1eaab7a050>\n -> <undetected_chromedriver.Chrome (session="31f83e63e76950e96fd0de1f9ad82d8c")>\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response\n raise exception_class(message, screen, stacktrace)\n | | | -> ['#0 0x55db32e20133 ', '#1 0x55db32b54966 ', '#2 0x55db32b910dc ', '#3 0x55db32b91211 ', ...\n | | -> None\n | -> 'no such element: Unable to locate element: {"method":"css selector","selector":"[class*=\'item-description\']"}\n (Session ...\n -> <class 'selenium.common.exceptions.NoSuchElementException'>\n\nselenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[class*='item-description']"}\n (Session info: chrome=113.0.5672.63)\nStacktrace:\n#0 0x55db32e20133 \n#1 0x55db32b54966 \n#2 0x55db32b910dc \n#3 0x55db32b91211 \n#4 0x55db32b86e26 \n#5 0x55db32bb0bfd \n#6 0x55db32b86d13 \n#7 0x55db32bb0d9e \n#8 0x55db32bc91c7 \n#9 0x55db32bb09a3 \n#10 0x55db32b8546a \n#11 0x55db32b8655e \n#12 0x55db32ddfcae \n#13 0x55db32de38fe \n#14 0x55db32decf20 \n#15 0x55db32de4923 \n#16 0x55db32db7c0e \n#17 0x55db32e07b08 \n#18 0x55db32e07c97 \n#19 0x55db32e18113 \n#20 0x7fd57b197b43 \n\n'
Arguments: ()

Кодировка текста в csv

При открытии файла не корректно отображалась кодировка текста, в коде изменил на utf-8-sig и кодировка отображается правильно. Совет прочитал на другом форуме.

Ошибка chromedriver mac os

MacBook-Pro-MacBook:parser_avito-master macbook$ python3 AvitoParser.py
2023-06-22 16:39:11.130 | INFO | main:logger_widget_init:233 - Запуск AvitoParser
2023-06-22 16:39:11.133 | INFO | main:logger_widget_init:234 - Чтобы начать работу, проверьте, чтобы поле URL было заполненными, остальное на Ваше усмотрение. Нужна помощь - нажмите на ссылку внизу окна.
2023-06-22 16:39:11.147 | INFO | main:logger_widget_init:236 - Удачного поиска !!!
2023-06-22 16:39:27.903 | INFO | main:logger_tg:225 - Данные для отправки в telegram не заполнены. Результат будет сохранен в файл и выведен здесь
2023-06-22 16:39:27.930 | INFO | main:start_scraping:141 - Начинаем поиск
Exception in thread Thread-1 (start_scraping):
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 3044, in get_local_driver
driver = undetected.Chrome(
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/undetected/init.py", line 294, in init
browser = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1824, in _execute_child
and os.path.dirname(executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/Users/macbook/Downloads/parser_avito-master/AvitoParser.py", line 152, in start_scraping
self.run_parse()
File "/Users/macbook/Downloads/parser_avito-master/AvitoParser.py", line 258, in run_parse
).parse()
^^^^^^^
File "/Users/macbook/Downloads/parser_avito-master/parser_cls.py", line 236, in parse
with SB(uc=True,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/plugins/sb_manager.py", line 815, in SB
sb.setUp()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 13825, in setUp
self.driver = self.get_new_driver(
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 3783, in get_new_driver
new_driver = browser_launcher.get_driver(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 1234, in get_driver
return get_local_driver(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 3349, in get_local_driver
return webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 49, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 54, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 206, in init
self.start_session(capabilities)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 291, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 346, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
Stacktrace:
0 chromedriver 0x000000010fd9c6b8 chromedriver + 4937400
1 chromedriver 0x000000010fd93b73 chromedriver + 4901747
2 chromedriver 0x000000010f951616 chromedriver + 435734
3 chromedriver 0x000000010f97dac6 chromedriver + 617158
4 chromedriver 0x000000010f97b67c chromedriver + 607868
5 chromedriver 0x000000010f9c2a08 chromedriver + 899592
6 chromedriver 0x000000010f9c1ebf chromedriver + 896703
7 chromedriver 0x000000010f9b8de3 chromedriver + 859619
8 chromedriver 0x000000010f986d7f chromedriver + 654719
9 chromedriver 0x000000010f9880de chromedriver + 659678
10 chromedriver 0x000000010fd582ad chromedriver + 4657837
11 chromedriver 0x000000010fd5d130 chromedriver + 4677936
12 chromedriver 0x000000010fd63def chromedriver + 4705775
13 chromedriver 0x000000010fd5e05a chromedriver + 4681818
14 chromedriver 0x000000010fd3092c chromedriver + 4495660
15 chromedriver 0x000000010fd7b838 chromedriver + 4802616
16 chromedriver 0x000000010fd7b9b7 chromedriver + 4802999
17 chromedriver 0x000000010fd8c99f chromedriver + 4872607
18 libsystem_pthread.dylib 0x00007fff7d29a661 _pthread_body + 340
19 libsystem_pthread.dylib 0x00007fff7d29a50d _pthread_body + 0
20 libsystem_pthread.dylib 0x00007fff7d299bf9 thread_start + 13

2023-06-22 16:40:59.669 | INFO | main:stop_scraping:177 - Идет остановка. Пожалуйста, подождите
MacBook-Pro-MacBook:parser_avito-master macbook$ python3 AvitoParser.py
2023-06-22 16:39:11.130 | INFO | main:logger_widget_init:233 - Запуск AvitoParser
2023-06-22 16:39:11.133 | INFO | main:logger_widget_init:234 - Чтобы начать работу, проверьте, чтобы поле URL было заполненными, остальное на Ваше усмотрение. Нужна помощь - нажмите на ссылку внизу окна.
2023-06-22 16:39:11.147 | INFO | main:logger_widget_init:236 - Удачного поиска !!!
2023-06-22 16:39:27.903 | INFO | main:logger_tg:225 - Данные для отправки в telegram не заполнены. Результат будет сохранен в файл и выведен здесь
2023-06-22 16:39:27.930 | INFO | main:start_scraping:141 - Начинаем поиск
Exception in thread Thread-1 (start_scraping):
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 3044, in get_local_driver
driver = undetected.Chrome(
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/undetected/init.py", line 294, in init
browser = subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 1824, in _execute_child
and os.path.dirname(executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 152, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "/Users/macbook/Downloads/parser_avito-master/AvitoParser.py", line 152, in start_scraping
self.run_parse()
File "/Users/macbook/Downloads/parser_avito-master/AvitoParser.py", line 258, in run_parse
).parse()
^^^^^^^
File "/Users/macbook/Downloads/parser_avito-master/parser_cls.py", line 236, in parse
with SB(uc=True,
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/plugins/sb_manager.py", line 815, in SB
sb.setUp()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 13825, in setUp
self.driver = self.get_new_driver(
^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/fixtures/base_case.py", line 3783, in get_new_driver
new_driver = browser_launcher.get_driver(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 1234, in get_driver
return get_local_driver(
^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/seleniumbase/core/browser_launcher.py", line 3349, in get_local_driver
return webdriver.Chrome()
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 49, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 54, in init
super().init(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 206, in init
self.start_session(capabilities)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 291, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 346, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
Stacktrace:
0 chromedriver 0x000000010fd9c6b8 chromedriver + 4937400
1 chromedriver 0x000000010fd93b73 chromedriver + 4901747
2 chromedriver 0x000000010f951616 chromedriver + 435734
3 chromedriver 0x000000010f97dac6 chromedriver + 617158
4 chromedriver 0x000000010f97b67c chromedriver + 607868
5 chromedriver 0x000000010f9c2a08 chromedriver + 899592
6 chromedriver 0x000000010f9c1ebf chromedriver + 896703
7 chromedriver 0x000000010f9b8de3 chromedriver + 859619
8 chromedriver 0x000000010f986d7f chromedriver + 654719
9 chromedriver 0x000000010f9880de chromedriver + 659678
10 chromedriver 0x000000010fd582ad chromedriver + 4657837
11 chromedriver 0x000000010fd5d130 chromedriver + 4677936
12 chromedriver 0x000000010fd63def chromedriver + 4705775
13 chromedriver 0x000000010fd5e05a chromedriver + 4681818
14 chromedriver 0x000000010fd3092c chromedriver + 4495660
15 chromedriver 0x000000010fd7b838 chromedriver + 4802616
16 chromedriver 0x000000010fd7b9b7 chromedriver + 4802999
17 chromedriver 0x000000010fd8c99f chromedriver + 4872607
18 libsystem_pthread.dylib 0x00007fff7d29a661 _pthread_body + 340
19 libsystem_pthread.dylib 0x00007fff7d29a50d _pthread_body + 0
20 libsystem_pthread.dylib 0x00007fff7d299bf9 thread_start + 13

2023-06-22 16:40:59.669 | INFO | main:stop_scraping:177 - Идет остановка. Пожалуйста, подождите
Снимок экрана 2023-06-22 в 16 48 26

В процессе считывания возникла ... как я понимаю ошибка

url = title.find_element(*LocatorAvito.URL).get_attribute("href")
      │     │             │            └ ('css selector', "[data-marker='item-title']")
      │     │             └ <class 'locator.LocatorAvito'>
      │     └ <function WebElement.find_element at 0x0000028E43522B60>
      └ <seleniumbase.undetected.webelement.WebElement (session="cb5c86a08f9621887be1e1cfaf527ff5", element="70A08F309A729EADBEED4650...

File "D:\GitRepo\parser_avito.venv\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 178, in get_attribute
attribute_value = self.parent.execute_script(
│ └ <property object at 0x0000028E43526750>
└ <seleniumbase.undetected.webelement.WebElement (session="cb5c86a08f9621887be1e1cfaf527ff5", element="70A08F309A729EADBEED4650...
File "D:\GitRepo\parser_avito.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 408, in execute_script
return self.execute(command, {"script": script, "args": converted_args})["value"]
│ │ │ │ └ [<seleniumbase.undetected.webelement.WebElement (session="cb5c86a08f9621887be1e1cfaf527ff5", element="70A08F309A729EADBEED465...
│ │ │ └ '/* getAttribute */return (function(){return (function(){var h=this||self;function aa(a){return"string"==typeof a}function ba...
│ │ └ 'w3cExecuteScript'
│ └ <function WebDriver.execute at 0x0000028E434F5620>
└ <seleniumbase.undetected.Chrome (session="cb5c86a08f9621887be1e1cfaf527ff5")>
File "D:\GitRepo\parser_avito.venv\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 348, in execute
self.error_handler.check_response(response)
│ │ │ └ {'status': 500, 'value': '{"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=121.0.6167.1...
│ │ └ <function ErrorHandler.check_response at 0x0000028E43555B20>
│ └ <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x0000028E45E081A0>
└ <seleniumbase.undetected.Chrome (session="cb5c86a08f9621887be1e1cfaf527ff5")>
File "D:\GitRepo\parser_avito.venv\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
│ │ │ └ ['\tGetHandleVerifier [0x00007FF7CFE25E42+3538674]', '\t(No symbol) [0x00007FF7CFA44C02]', '\t(No symbol) [0x00007FF7CF8F599D...
│ │ └ None
│ └ 'script timeout\n (Session info: chrome=121.0.6167.140)'
└ <class 'selenium.common.exceptions.TimeoutException'>

selenium.common.exceptions.TimeoutException: Message: script timeout
(Session info: chrome=121.0.6167.140)
Stacktrace:
GetHandleVerifier [0x00007FF7CFE25E42+3538674]
(No symbol) [0x00007FF7CFA44C02]
(No symbol) [0x00007FF7CF8F599D]
(No symbol) [0x00007FF7CF97CB92]
(No symbol) [0x00007FF7CF95F0AA]
(No symbol) [0x00007FF7CF97BDE3]
(No symbol) [0x00007FF7CF95EE53]
(No symbol) [0x00007FF7CF92F514]
(No symbol) [0x00007FF7CF930631]
GetHandleVerifier [0x00007FF7CFE56CAD+3738973]
GetHandleVerifier [0x00007FF7CFEAC506+4089270]
GetHandleVerifier [0x00007FF7CFEA4823+4057299]
GetHandleVerifier [0x00007FF7CFB75C49+720121]
(No symbol) [0x00007FF7CFA5126F]
(No symbol) [0x00007FF7CFA4C304]
(No symbol) [0x00007FF7CFA4C432]
(No symbol) [0x00007FF7CFA3BD04]
BaseThreadInitThunk [0x00007FFBF91A257D+29]
RtlUserThreadStart [0x00007FFBF9E8AA58+40]

Слишком длинное сообщение для лога

Issue и фикс в либе loguru: Delgan/loguru#821 (comment)

Падает в методе __pretty_log

--- Logging error ---
Traceback (most recent call last):
  File "C:\Users\Gregory\AppData\Local\Programs\Python\Python310\lib\site-packages\notifiers\logging.py", line 50, in emit
    self.provider.notify(raise_on_errors=True, **data)
  File "C:\Users\Gregory\AppData\Local\Programs\Python\Python310\lib\site-packages\notifiers\core.py", line 303, in notify
    data = self._process_data(**kwargs)
  File "C:\Users\Gregory\AppData\Local\Programs\Python\Python310\lib\site-packages\notifiers\core.py", line 235, in _process_data
    self._validate_data(data)
  File "C:\Users\Gregory\AppData\Local\Programs\Python\Python310\lib\site-packages\notifiers\core.py", line 208, in _validate_data
    raise BadArguments(validation_error=msg, provider=self.name, data=data)
notifiers.exceptions.BadArguments: Error with sent data: "***Длинная строка***" is too long

Ошибка с кодировкой данных для записи данных в файл, как можно поменять кодировку?

2023-05-16 18:19:14.771 | ERROR | parser_cls:__paginator:79 - An error has been caught in function '__paginator', process 'MainProcess' (31792), thread 'Thread-3' (20864):
Traceback (most recent call last):

File "n39\lib\threading.py", line 930, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x000002556E521550>
└ <Thread(Thread-3, started 20864)>

File "\threading.py", line 973, in _bootstrap_inner
self.run()
│ └ <function Thread.run at 0x000002556E521310>
└ <Thread(Thread-3, started 20864)>

File "39\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <Thread(Thread-3, started 20864)>
│ │ │ └ ()
│ │ └ <Thread(Thread-3, started 20864)>
│ └ <bound method Window.start_scraping of <main.Window object .>>
└ <Thread(Thread-3, started 20864)>

File "ito-master\AvitoParser.py", line 150, in start_scraping
self.run_parse()
│ └ <function Window.run_parse at 0x00000255710DA700>
└ <main.Window object .>

File "aster\AvitoParser.py", line 249, in run_parse
AvitoParse(
└ <class 'parser_cls.AvitoParse'>

File "parser_avito-master\parser_cls.py", line 252, in parse
self.__paginator()
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "ser_avito-master\parser_cls.py", line 79, in __paginator
self.__parse_page()
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "master\parser_cls.py", line 126, in __parse_page
self.__save_data(data=data)
│ └ {'name': 'Мониторы 24 IPS Fujitsu B24W-7 LED', 'description': 'Мониторы Fujitsu B24W-7 Led — В наличии 200шт. Гарантия от маг...
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "ster\parser_cls.py", line 189, in __save_data
writer.writerow([
│ └ <method 'writerow' of '_csv.writer' objects>
└ <_csv.writer object at 0x0000025572C5F630>

File "\Python39\lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
│ │ │ │ │ └ <EncodingMap object at 0x000002556DACBBD0>
│ │ │ │ └ 'strict'
│ │ │ └ <encodings.cp1251.IncrementalEncoder object at 0x0000025573674D90>
│ │ └ 'Мониторы 24 IPS Fujitsu B24W-7 LED,7500,https://www.avito.ru/moskva/tovary_dlya_kompyutera/monitory_24_ips_fujitsu_b24w-7_le...
│ └
└ <module 'codecs' from '\Python\Python39\lib\codecs.py'>

UnicodeEncodeError: 'charmap' codec can't encode character '\xb2' in position 393: character maps to
2023-05-16 18:20:34.648 | SUCCESS | parser_cls:__pretty_log:138 -
Монитор LG 25UM58-P 25'' UW-FHD
Цена: 10000
Описание: Продаю свой монитор в связи с приобретением нового. Состояние хорошее. За время использования чутка подпортился внешний вид (небольшие царапины на ножке). Диагональ — 25 дюймов. Тип матрицы — Ips. Разрешение — 2560 × 1080 (стороны 21:9). Время отклика — 5 мс. Яркость — 250 кд/м2. Контрастность — 1000:1. 2 порта Hdmi (в комплекте переходник vga-hdmi). + кабель Hdmi-Hdmi.
Просмотров: 0
Дата публикации: сегодня в 18:00
Продавец: Частное лицо
Ссылка: https://www.avito.ru/moskva/tovary_dlya_kompyutera/monitor_lg_25um58-p_25_uw-fhd_3185904982

2023-05-16 18:20:34.660 | ERROR | parser_cls:__paginator:79 - An error has been caught in function '__paginator', process 'MainProcess' (31792), thread 'Thread-3' (20864):
Traceback (most recent call last):

File "hon39\lib\threading.py", line 930, in _bootstrap
self._bootstrap_inner()
│ └ <function Thread._bootstrap_inner at 0x000002556E521550>
└ <Thread(Thread-3, started 20864)>

File "ib\threading.py", line 973, in _bootstrap_inner
self.run()
│ └ <function Thread.run at 0x000002556E521310>
└ <Thread(Thread-3, started 20864)>

File "C:\Users\Ilya\AppData\Local\Programs\Python\Python39\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
│ │ │ │ │ └ {}
│ │ │ │ └ <Thread(Thread-3, started 20864)>
│ │ │ └ ()
│ │ └ <Thread(Thread-3, started 20864)>
│ └ <bound method Window.start_scraping of <main.Window object .>>
└ <Thread(Thread-3, started 20864)>

File "parser_avito-master\AvitoParser.py", line 150, in start_scraping
self.run_parse()
│ └ <function Window.run_parse at 0x00000255710DA700>
└ <main.Window object .>

File "\parser_avito-master\AvitoParser.py", line 249, in run_parse
AvitoParse(
└ <class 'parser_cls.AvitoParse'>

File " (6)\parser_avito-master\parser_cls.py", line 252, in parse
self.__paginator()
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "py", line 79, in __paginator
self.__parse_page()
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "er (6)\parser_avito-master\parser_cls.py", line 126, in __parse_page
self.__save_data(data=data)
│ └ {'name': "Монитор LG 25UM58-P 25'' UW-FHD", 'description': 'Продаю свой монитор в связи с приобретением нового. Состояние хор...
└ <parser_cls.AvitoParse object at 0x00000255710CEBB0>

File "\parser_avito-master\parser_cls.py", line 189, in __save_data
writer.writerow([
│ └ <method 'writerow' of '_csv.writer' objects>
└ <_csv.writer object at 0x0000025573684860>

File "\Python39\lib\encodings\cp1251.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
│ │ │ │ │ └ <EncodingMap object at 0x000002556DACBBD0>
│ │ │ │ └ 'strict'
│ │ │ └ <encodings.cp1251.IncrementalEncoder object at 0x000002557368FBB0>
│ │ └ "Монитор LG 25UM58-P 25'' UW-FHD,10000,https://www.avito.ru/moskva/tovary_dlya_kompyutera/monitor_lg_25um58-p_25_uw-fhd_31859...
│ └
└ <module 'codecs' from '\Python\Python39\lib\codecs.py'>

UnicodeEncodeError: 'charmap' codec can't encode character '\xd7' in position 345: character maps to

Добавьте пожалуйста функционал

Добрый вечер. Спасибо за интересный софт, но мне в нём очень не хватает функции ввода нескольких chat_id через запятую, дабы сообщения из бота видел еще и мой друг. Понимаю что "спасибо" тут не достаточно, посему отправил вам небольшое пожертвование за вашу работу. Заранее спасибо!

image

configparser.InterpolationSyntaxError: '%' must be followed by '%'

Авито при указании радиуса добавляет координаты и получается ссылка вида:

https://www.avito.ru/sevastopol/bytovaya_tehnika/dlya_doma/stiralnye_mashiny-ASgBAgICAkRgpE_OB6ZP?cd=1&geoCoords=44.616687%2C33.525432&localPriority=0&radius=50&s=104

При таком виде ошибка:

Traceback (most recent call last):
File "/parser_avito-master/parser_cls.py", line 256, in
url = config["Avito"]["URL"]
File "/usr/lib/python3.10/configparser.py", line 1259, in getitem
return self._parser.get(self._name, key)
File "/usr/lib/python3.10/configparser.py", line 800, in get
return self._interpolation.before_get(self, section, option, value,
File "/usr/lib/python3.10/configparser.py", line 395, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "/usr/lib/python3.10/configparser.py", line 442, in _interpolate_some
raise InterpolationSyntaxError(
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%2C33.525432&localPriority=0&radius=50&s=104'

Не работает на маке

Добрый день, запустил код на маке - получил пустое окно без кнопок = нет возможности запустить парсер. Подскажите, пожалуйста, как исправить?
Снимок экрана 2024-01-03 в 01 29 37

Ошибка перед сменой страницы

requirements через pip установил, Chrome 118 версии, скрипт работает отлично, но до того как дойдет до следующей страницы, как я понял. Текст ошибки в изображении
image

Изменился путь selector "[class*='item-description']"

  1. настройки:
    [Avito]
    url = https://www.avito.ru/moskva/tovary_dlya_kompyutera/monitory-ASgBAgICAUTGB4Bo?cd=1
    chat_id =
    tg_token =
    num_ads = 1
    freq = 2
    keys = Мониторы, Монитор
    max_price = 10000
    min_price = 1000
  2. Проработал менее часа
  3. Ошибка было только эта
  4. Скрипт продолжил работу, но ошибка никуда не исчезла.
    2023-05-08 17:38:59.209 | ERROR | main:__paginator:74 - An error has been caught in function '__paginator', process 'MainProcess' (142117), thread 'MainT hread' (140551600046080):
    Traceback (most recent call last):

File "/root/parser/parser_avito-master/parser_cls.py", line 208, in
).parse()

File "/root/parser/parser_avito-master/parser_cls.py", line 160, in parse
self.__paginator()
└ <main.AvitoParse object at 0x7fd4b6a4f5b0>

File "/root/parser/parser_avito-master/parser_cls.py", line 74, in __paginator
self.__parse_page()
└ <main.AvitoParse object at 0x7fd4b6a4f5b0>

File "/root/parser/parser_avito-master/parser_cls.py", line 100, in __parse_pa ge
description = title.find_element(LocatorAvito.DESCRIPTIONS).text
│ │ │ └ ('css selector', "[class
=' item-description']")
│ │ └ <class 'locator.LocatorAvito'>
│ └ <function WebElement.find_element at 0x7fd4b71a1090>
└ <undetected_chromedriver.webelement.WebElement (session="8e4 780bde71e07501846c8dafd2d46cb", element="9484AD4459801A6B5423AC83...

File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webele ment.py", line 426, in find_element
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": valu e})["value"]
│ │ │ │ │ └ "[ class*='item-description']"
│ │ │ │ └ 'css selector'
│ │ │ └ 'findChildElement'
│ │ └ <class 'selenium.webdriver.remote.command.Command'>
│ └ <function WebElement._execute at 0x7fd4b71a1000>
└ <undetected_chromedriver.webelement.WebElement (session="8e4780bde7 1e07501846c8dafd2d46cb", element="9484AD4459801A6B5423AC83...
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webele ment.py", line 404, in _execute
return self._parent.execute(command, params)
│ │ │ │ └ {'using': 'css selector', 'value': "[ class*='item-description']", 'id': '9484AD4459801A6B5423AC835E1F9AD5_element_477 '}
│ │ │ └ 'findChildElement'
│ │ └ <function WebDriver.execute at 0x7fd4b71b1510>
│ └ <undetected_chromedriver.Chrome (session="8e4780bde71e07501846 c8dafd2d46cb")>
└ <undetected_chromedriver.webelement.WebElement (session="8e4780bde7 1e07501846c8dafd2d46cb", element="9484AD4459801A6B5423AC83...
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdri ver.py", line 440, in execute
self.error_handler.check_response(response)
│ │ │ └ {'status': 404, 'value': '{"value":{"err or":"no such element","message":"no such element: Unable to locate element: {\" metho...
│ │ └ <function ErrorHandler.check_response at 0x7fd4b73948b0 >
│ └ <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fd4 b6a4fbe0>
└ <undetected_chromedriver.Chrome (session="8e4780bde71e07501846c8dafd2d46cb ")>
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorh andler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
│ │ │ └ ['#0 0x562e04be8133 ', '#1 0x562e0491c966 ', '#2 0x562e049590dc ', '#3 0x562e04959211 ', ...
│ │ └ None
│ └ 'no such element: Unable to locate element: {"method ":"css selector","selector":"[class*='item-description']"}\n (Session ...
└ <class 'selenium.common.exceptions.NoSuchElementException'>

selenium.common.exceptions.NoSuchElementException: Message: no such element: Una ble to locate element: {"method":"css selector","selector":"[class*='item-descri ption']"}
(Session info: chrome=113.0.5672.63)
Stacktrace:
#0 0x562e04be8133
#1 0x562e0491c966
#2 0x562e049590dc
#3 0x562e04959211
#4 0x562e0494ee26
#5 0x562e04978bfd
#6 0x562e0494ed13
#7 0x562e04978d9e
#8 0x562e049911c7
#9 0x562e049789a3
#10 0x562e0494d46a
#11 0x562e0494e55e
#12 0x562e04ba7cae
#13 0x562e04bab8fe
#14 0x562e04bb4f20
#15 0x562e04bac923
#16 0x562e04b7fc0e
#17 0x562e04bcfb08
#18 0x562e04bcfc97
#19 0x562e04be0113
#20 0x7f4da3007b43

--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/loguru/_logger.py", line 1251, i n catch_wrapper
return function(*args, **kwargs)
File "/root/parser/parser_avito-master/parser_cls.py", line 100, in __parse_pa ge
description = title.find_element(LocatorAvito.DESCRIPTIONS).text
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webele ment.py", line 426, in find_element
return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": valu e})["value"]
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webele ment.py", line 404, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdri ver.py", line 440, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorh andler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Una ble to locate element: {"method":"css selector","selector":"[class
='item-descri ption']"}
(Session info: chrome=113.0.5672.63)
Stacktrace:
#0 0x562e04be8133
#1 0x562e0491c966
#2 0x562e049590dc
#3 0x562e04959211
#4 0x562e0494ee26
#5 0x562e04978bfd
#6 0x562e0494ed13
#7 0x562e04978d9e
#8 0x562e049911c7
#9 0x562e049789a3
#10 0x562e0494d46a
#11 0x562e0494e55e
#12 0x562e04ba7cae
#13 0x562e04bab8fe
#14 0x562e04bb4f20
#15 0x562e04bac923
#16 0x562e04b7fc0e
#17 0x562e04bcfb08
#18 0x562e04bcfc97
#19 0x562e04be0113
#20 0x7f4da3007b43

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/notifiers/logging.py", line 50, in emit
self.provider.notify(raise_on_errors=True, data)
File "/usr/local/lib/python3.10/dist-packages/notifiers/core.py", line 303, in notify
data = self._process_data(kwargs)
File "/usr/local/lib/python3.10/dist-packages/notifiers/core.py", line 235, in _process_data
self._validate_data(data)
File "/usr/local/lib/python3.10/dist-packages/notifiers/core.py", line 208, in _validate_data
raise BadArguments(validation_error=msg, provider=self.name, data=data)
notifiers.exceptions.BadArguments: Error with sent data: 'An error has been caug ht in function '__paginator', process 'MainProcess' (142117), thread 'MainT hread' (140551600046080):\nTraceback (most recent call last):\n\n File "/root/ parser/parser_avito-master/parser_cls.py", line 208, in \n ).parse()\ n\n File "/root/parser/parser_avito-master/parser_cls.py", line 160, in parse\n self.__paginator()\n -> <main.AvitoParse object at 0x7fd4b6a4f5b0>\n\ n> File "/root/parser/parser_avito-master/parser_cls.py", line 74, in __paginato r\n self.__parse_page()\n -> <main.AvitoParse object at 0x7fd4b6a4f5b0 >\n\n File "/root/parser/parser_avito-master/parser_cls.py", line 100, in _par se_page\n description = title.find_element(LocatorAvito.DESCRIPTIONS).text\n | | | -> ('css selector', "[class ='item-description']")\n | | -> <class 'loc ator.LocatorAvito'>\n | -> <function WebElement.find_eleme nt at 0x7fd4b71a1090>\n -> <undetected_chromedriver.webelement. WebElement (session="8e4780bde71e07501846c8dafd2d46cb", element="9484AD4459801A6 B5423AC83...\n\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriv er/remote/webelement.py", line 426, in find_element\n return self._execute(Co mmand.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]\n | | | | | -> "[class='ite m-description']"\n | | | | -> 'css selector'\n | | | -> 'findChildElement'\ n | | -> <class 'selenium.webdriver.remote.command.Command\ '>\n | -> <function WebElement._execute at 0x7fd4b71a1000>\n -> <undetected_chromedriver.webelement.WebElement (session="8e4780bde71e0750 1846c8dafd2d46cb", element="9484AD4459801A6B5423AC83...\n File "/usr/local/lib/ python3.10/dist-packages/selenium/webdriver/remote/webelement.py", line 404, in _execute\n return self._parent.execute(command, params)\n | | | | -> {'using': 'css selector', 'value': "[class='item -description']", 'id': '9484AD4459801A6B5423AC835E1F9AD5_element_477'}\n | | | -> 'findChildElement'\n | | -> <function WebDriver.execute at 0x7fd4b71b1510>\n | -> <undetected chromedriver.Chrome (session="8e4780bde71e07501846c8dafd2d46cb")>\n -> <undetected_chromedriver.webelement.WebElement (session="8e4780bde71e07501846c8 dafd2d46cb", element="9484AD4459801A6B5423AC83...\n File "/usr/local/lib/python 3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute \n self.error_handler.check_response(response)\n | | | -> {'status': 404, 'value': '{"value":{"error":"no such element"," message":"no such element: Unable to locate element: {\\"metho...\n | | -> <function ErrorHandler.check_response at 0x7fd4b73948b0>\n | -> <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fd4b6a4fb e0>\n -> <undetected_chromedriver.Chrome (session="8e4780bde71e07501846c8dafd 2d46cb")>\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/re mote/errorhandler.py", line 245, in check_response\n raise exception_class(me ssage, screen, stacktrace)\n | | | -> ['#0 0x562e04be8133 ', '#1 0x562e0491c966 ', '#2 0x562e049590dc ', '#3 0x562e04959211 ', ...\n | | -> None\n | -> 'no such element: Unable to locate element: {"method":"css selector","selector":"[class=\'item-description\'] "}\n (Session ...\n -> <class 'selenium.common.exceptions.NoSuchElem entException'>\n\nselenium.common.exceptions.NoSuchElementException: Message: n o such element: Unable to locate element: {"method":"css selector","selector":"[ class='item-description']"}\n (Session info: chrome=113.0.5672.63)\nStacktra ce:\n#0 0x562e04be8133 \n#1 0x562e0491c966 \n#2 0x562e049590dc \n#3 0x562e04959211 \n#4 0x562e0494ee26 \n#5 0x562e0 4978bfd \n#6 0x562e0494ed13 \n#7 0x562e04978d9e \n#8 0x562e049911c7 \n#9 0x562e049789a3 \n#10 0x562e0494d46a \n#11 0x562e0494e55e \n#12 0x562e04ba7cae \n#13 0x562e04bab 8fe \n#14 0x562e04bb4f20 \n#15 0x562e04bac923 \n#16 0 x562e04b7fc0e \n#17 0x562e04bcfb08 \n#18 0x562e04bcfc97 \n#19 0x562e04be0113 \n#20 0x7f4da3007b43 \n\n\n' is too lo ng
Call stack:
File "/root/parser/parser_avito-master/parser_cls.py", line 208, in
).parse()
File "/root/parser/parser_avito-master/parser_cls.py", line 160, in parse
self.__paginator()
File "/root/parser/parser_avito-master/parser_cls.py", line 74, in __paginator
self.__parse_page()
File "/usr/local/lib/python3.10/dist-packages/loguru/_logger.py", line 1250, i n catch_wrapper
with catcher:
File "/usr/local/lib/python3.10/dist-packages/loguru/_logger.py", line 1217, i n exit
logger._log(level, from_decorator, catch_options, message, (), {})
File "/usr/local/lib/python3.10/dist-packages/loguru/_logger.py", line 2002, i n _log
handler.emit(log_record, level_id, from_decorator, raw, colored_message)
File "/usr/local/lib/python3.10/dist-packages/loguru/_handler.py", line 197, i n emit
self._sink.write(str_record)
File "/usr/local/lib/python3.10/dist-packages/loguru/_simple_sinks.py", line 5 0, in write
self._handler.handle(record)
File "/usr/lib/python3.10/logging/init.py", line 968, in handle
self.emit(record)
File "/usr/local/lib/python3.10/dist-packages/notifiers/logging.py", line 52, in emit
self.handleError(record)
Message: 'An error has been caught in function '__paginator', process 'MainPr ocess' (142117), thread 'MainThread' (140551600046080):\nTraceback (most rece nt call last):\n\n File "/root/parser/parser_avito-master/parser_cls.py", line 208, in \n ).parse()\n\n File "/root/parser/parser_avito-master/pars er_cls.py", line 160, in parse\n self.__paginator()\n -> <main.AvitoPa rse object at 0x7fd4b6a4f5b0>\n\n> File "/root/parser/parser_avito-master/parser _cls.py", line 74, in __paginator\n self.__parse_page()\n -> <main.Avi toParse object at 0x7fd4b6a4f5b0>\n\n File "/root/parser/parser_avito-master/pa rser_cls.py", line 100, in __parse_page\n description = title.find_element(L ocatorAvito.DESCRIPTIONS).text\n | | | -> ('css selector', "[class='item-description']")\n | | -> <class 'locator.LocatorAvito'>\n | -> <function WebElement.find_element at 0x7fd4b71a1090>\n -> <und etected_chromedriver.webelement.WebElement (session="8e4780bde71e07501846c8dafd2 d46cb", element="9484AD4459801A6B5423AC83...\n\n File "/usr/local/lib/python3.1 0/dist-packages/selenium/webdriver/remote/webelement.py", line 426, in find_elem ent\n return self._execute(Command.FIND_CHILD_ELEMENT, {"using": by, "value": value})["value"]\n | | | | | -> "[class='item-description']"\n | | | | -> 'css selector'\n | | | -> 'findChildElement'\n | | -> <class 'selenium.w ebdriver.remote.command.Command'>\n | -> <function WebElement._exe cute at 0x7fd4b71a1000>\n -> <undetected_chromedriver.webelement.WebEl ement (session="8e4780bde71e07501846c8dafd2d46cb", element="9484AD4459801A6B5423 AC83...\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remo te/webelement.py", line 404, in _execute\n return self._parent.execute(comman d, params)\n | | | | -> {'using': 'css select or', 'value': "[class='item-description']", 'id': '9484AD4459801A6B5423 AC835E1F9AD5_element_477'}\n | | | -> 'findChildEleme nt'\n | | -> <function WebDriver.execute at 0x7fd4b71b1510>\ n | -> <undetected_chromedriver.Chrome (session="8e4780bde71e075018 46c8dafd2d46cb")>\n -> <undetected_chromedriver.webelement.WebElement (session="8e4780bde71e07501846c8dafd2d46cb", element="9484AD4459801A6B5423AC83.. .\n File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/web driver.py", line 440, in execute\n self.error_handler.check_response(response )\n | | | -> {'status': 404, 'value': '{"val ue":{"error":"no such element","message":"no such element: Unable to locate elem ent: {\\"metho...\n | | -> <function ErrorHandler.check_resp onse at 0x7fd4b73948b0>\n | -> <selenium.webdriver.remote.errorhandler.Err orHandler object at 0x7fd4b6a4fbe0>\n -> <undetected_chromedriver.Chrome (ses sion="8e4780bde71e07501846c8dafd2d46cb")>\n File "/usr/local/lib/python3.10/dis t-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_respon se\n raise exception_class(message, screen, stacktrace)\n | | | -> ['#0 0x562e04be8133 ', '#1 0x562e0491c966 ', '#2 0x562e049590dc ', '#3 0x562e04959211 ', . ..\n | | -> None\n | -> 'n o such element: Unable to locate element: {"method":"css selector","selector":"[ class*=\'item-description\']"}\n (Session ...\n -> <class 'selen ium.common.exceptions.NoSuchElementException'>\n\nselenium.common.exceptions.No SuchElementException: Message: no such element: Unable to locate element: {"meth od":"css selector","selector":"[class*='item-description']"}\n (Session info: chrome=113.0.5672.63)\nStacktrace:\n#0 0x562e04be8133 \n#1 0x562e0491c 966 \n#2 0x562e049590dc \n#3 0x562e04959211 \n#4 0x56 2e0494ee26 \n#5 0x562e04978bfd \n#6 0x562e0494ed13 \n #7 0x562e04978d9e \n#8 0x562e049911c7 \n#9 0x562e049789a3 \n#10 0x562e0494d46a \n#11 0x562e0494e55e \n#12 0x562e04b a7cae \n#13 0x562e04bab8fe \n#14 0x562e04bb4f20 \n#15 0x562e04bac923 \n#16 0x562e04b7fc0e \n#17 0x562e04bcfb08 \n#18 0x562e04bcfc97 \n#19 0x562e04be0113 \n#20 0x7f4da30 07b43 \n\n'
Arguments: ()

ValueError: invalid literal for int() with base 10: '

image

(venv) nikita@nikita-ubuntu:~/VS_Code_Projects/AvitoParser/parser_avito$ python3 AvitoParser.py
2023-07-16 21:27:56.946 | INFO | main:logger_widget_init:233 - Запуск AvitoParser
2023-07-16 21:27:56.949 | INFO | main:logger_widget_init:234 - Чтобы начать работу, проверьте, чтобы поле URL было заполненными, остальное на Ваше усмотрение. Нужна помощь - нажмите на ссылку внизу окна.
2023-07-16 21:27:56.954 | INFO | main:logger_widget_init:236 - Удачного поиска !!!
2023-07-16 21:28:44.241 | INFO | main:logger_tg:225 - Данные для отправки в telegram не заполнены. Результат будет сохранен в файл и выведен здесь
2023-07-16 21:28:44.242 | INFO | main:telegram_log_test:124 - Должны быть заполнены поля ТОКЕН TELEGRAM и CHAT ID TELEGRAM
2023-07-16 21:28:48.023 | INFO | main:logger_tg:225 - Данные для отправки в telegram не заполнены. Результат будет сохранен в файл и выведен здесь
2023-07-16 21:28:48.044 | INFO | main:start_scraping:141 - Начинаем поиск
Exception in thread Thread-1 (start_scraping):
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/home/nikita/VS_Code_Projects/AvitoParser/parser_avito/AvitoParser.py", line 152, in start_scraping
self.run_parse()
File "/home/nikita/VS_Code_Projects/AvitoParser/parser_avito/AvitoParser.py", line 256, in run_parse
max_price=int(max_price),
ValueError: invalid literal for int() with base 10: ''

ошибка с получение тестового сообщения в тг бота

2024-03-13 19:20:00.006 | SUCCESS | main:telegram_log_test:164 - test
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\notifiers\logging.py", line 50, in emit
self.provider.notify(raise_on_errors=True, **data)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\notifiers\core.py", line 306, in notify
rsp.raise_on_errors()
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\notifiers\core.py", line 60, in raise_on_errors
raise NotificationError(
notifiers.exceptions.NotificationError: Notification errors: Bad Request: chat not found
Call stack:
File "c:\Users\Admin001\Documents\ccode\parser_avito-master\AvitoParser.py", line 331, in
Window().mainloop()
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\customtkinter\windows\ctk_tk.py", line 165, in mainloop
super().mainloop(*args, **kwargs)
File "C:\Users\Admin001\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 1504, in mainloop
self.tk.mainloop(n)
File "C:\Users\Admin001\AppData\Local\Programs\Python\Python312\Lib\tkinter_init_.py", line 1967, in call
return self.func(*args)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
self._command()
File "c:\Users\Admin001\Documents\ccode\parser_avito-master\AvitoParser.py", line 164, in telegram_log_test
logger.success('test')
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\loguru_logger.py", line 2018, in success
__self._log("SUCCESS", False, __self._options, __message, args, kwargs)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\loguru_logger.py", line 2002, in _log
handler.emit(log_record, level_id, from_decorator, raw, colored_message)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\loguru_handler.py", line 197, in emit
self._sink.write(str_record)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\loguru_simple_sinks.py", line 50, in write
self.handler.handle(record)
File "C:\Users\Admin001\AppData\Local\Programs\Python\Python312\Lib\logging_init
.py", line 1028, in handle
self.emit(record)
File "C:\Users\Admin001\Documents\ccode\parser_avito-master\venv\Lib\site-packages\notifiers\logging.py", line 52, in emit
self.handleError(record)
Message: 'test'
Arguments: ()
2024-03-13 19:20:03.737 | INFO | main:telegram_log_test:166 - Если сообщение пришло к Вам в telegram - значит всё настроено правильно. Если нет - результат парсинга всегда можно посмотреть в папке result или ниже

Настройка сообщение в ТГ

Добрый день,
Подскажите, пожалуйста, как уйти от ошибки Notification errors: Forbidden: bots can't send messages to bots
Из readme, к сожалению, не смог разобраться

Ошибка парсинга description

При запуске часто выходит ошибка, что item-description не найден.
Собирать description можно так:
DESCRIPTIONS = (By.CSS_SELECTOR, "[style*='webkit']")
тестировалось на недвижимости.

Cannot install -r requirements.txt (line 69), -r requirements.txt (line 70) and trio-websocket==0.10.2 because these package versions have conflicting dependencies.

(venv) nikita@nikita-ubuntu:~/VS_Code_Projects/AvitoParser/parser_avito$ pip install -r requirements.txt
Collecting async-generator==1.10
Using cached async_generator-1.10-py3-none-any.whl (18 kB)
Collecting attrs==23.1.0
Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting beautifulsoup4==4.12.2
Using cached beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Collecting behave==1.2.6
Using cached behave-1.2.6-py2.py3-none-any.whl (136 kB)
Collecting blinker==1.6.2
Using cached blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting Brotli==1.0.9
Using cached Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB)
Collecting certifi==2022.12.7
Using cached certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting cffi==1.15.1
Using cached cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
Collecting chardet==5.1.0
Using cached chardet-5.1.0-py3-none-any.whl (199 kB)
Collecting charset-normalizer==3.1.0
Using cached charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB)
Collecting click==8.1.3
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting colorama==0.4.6
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting cryptography==41.0.1
Using cached cryptography-41.0.1-cp37-abi3-manylinux_2_28_x86_64.whl (4.3 MB)
Collecting cssselect==1.2.0
Using cached cssselect-1.2.0-py2.py3-none-any.whl (18 kB)
Collecting customtkinter==5.2.0
Using cached customtkinter-5.2.0-py3-none-any.whl (295 kB)
Collecting darkdetect==0.8.0
Using cached darkdetect-0.8.0-py3-none-any.whl (9.0 kB)
Collecting exceptiongroup==1.1.1
Using cached exceptiongroup-1.1.1-py3-none-any.whl (14 kB)
Collecting execnet==1.9.0
Using cached execnet-1.9.0-py2.py3-none-any.whl (39 kB)
Collecting fasteners==0.18
Using cached fasteners-0.18-py3-none-any.whl (18 kB)
Collecting filelock==3.12.2
Using cached filelock-3.12.2-py3-none-any.whl (10 kB)
Collecting h11==0.14.0
Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting h2==4.1.0
Using cached h2-4.1.0-py3-none-any.whl (57 kB)
Collecting hpack==4.0.0
Using cached hpack-4.0.0-py3-none-any.whl (32 kB)
Collecting hyperframe==6.0.1
Using cached hyperframe-6.0.1-py3-none-any.whl (12 kB)
Collecting idna==3.4
Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting importlib-metadata==6.6.0
Using cached importlib_metadata-6.6.0-py3-none-any.whl (22 kB)
Collecting iniconfig==2.0.0
Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting jaraco.classes==3.2.3
Using cached jaraco.classes-3.2.3-py3-none-any.whl (6.0 kB)
Collecting jeepney==0.8.0
Using cached jeepney-0.8.0-py3-none-any.whl (48 kB)
Collecting jsonschema==4.17.3
Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB)
Collecting kaitaistruct==0.10
Using cached kaitaistruct-0.10-py2.py3-none-any.whl (7.0 kB)
Collecting keyring==23.13.1
Using cached keyring-23.13.1-py3-none-any.whl (37 kB)
Collecting loguru==0.7.0
Using cached loguru-0.7.0-py3-none-any.whl (59 kB)
Collecting markdown-it-py==3.0.0
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting mdurl==0.1.2
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Collecting more-itertools==9.1.0
Using cached more_itertools-9.1.0-py3-none-any.whl (54 kB)
Collecting notifiers==1.3.3
Using cached notifiers-1.3.3-py3-none-any.whl (43 kB)
Collecting outcome==1.2.0
Using cached outcome-1.2.0-py2.py3-none-any.whl (9.7 kB)
Collecting packaging==23.1
Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting parameterized==0.9.0
Using cached parameterized-0.9.0-py2.py3-none-any.whl (20 kB)
Collecting parse==1.19.0
Using cached parse-1.19.0-py2.py3-none-any.whl (18 kB)
Collecting parse-type==0.6.0
Using cached parse_type-0.6.0-py2.py3-none-any.whl (32 kB)
Collecting pdbp==1.4.0
Using cached pdbp-1.4.0-py3-none-any.whl (17 kB)
Collecting platformdirs==3.5.3
Using cached platformdirs-3.5.3-py3-none-any.whl (15 kB)
Collecting pluggy==1.0.0
Using cached pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting py==1.11.0
Using cached py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting pyasn1==0.5.0
Using cached pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
Collecting pycparser==2.21
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting Pygments==2.15.1
Using cached Pygments-2.15.1-py3-none-any.whl (1.1 MB)
Collecting pynose==1.4.5
Using cached pynose-1.4.5-py3-none-any.whl (115 kB)
Collecting pyOpenSSL==23.2.0
Using cached pyOpenSSL-23.2.0-py3-none-any.whl (59 kB)
Collecting pyotp==2.8.0
Using cached pyotp-2.8.0-py3-none-any.whl (12 kB)
Collecting pyparsing==3.0.9
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting pyrsistent==0.19.3
Using cached pyrsistent-0.19.3-py3-none-any.whl (57 kB)
Collecting PySocks==1.7.1
Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting pytest==7.3.2
Using cached pytest-7.3.2-py3-none-any.whl (320 kB)
Collecting pytest-forked==1.6.0
Using cached pytest_forked-1.6.0-py3-none-any.whl (4.9 kB)
Collecting pytest-html==2.0.1
Using cached pytest_html-2.0.1-py2.py3-none-any.whl (15 kB)
Collecting pytest-metadata==3.0.0
Using cached pytest_metadata-3.0.0-py3-none-any.whl (10 kB)
Collecting pytest-ordering==0.6
Using cached pytest_ordering-0.6-py3-none-any.whl (4.6 kB)
Collecting pytest-rerunfailures==11.1.2
Using cached pytest_rerunfailures-11.1.2-py3-none-any.whl (12 kB)
Collecting pytest-xdist==3.3.1
Using cached pytest_xdist-3.3.1-py3-none-any.whl (41 kB)
Collecting PyYAML==6.0
Using cached PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (682 kB)
Collecting requests==2.31.0
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Collecting requests-toolbelt==1.0.0
Using cached requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
Collecting rich==13.4.2
Using cached rich-13.4.2-py3-none-any.whl (239 kB)
Collecting sbvirtualdisplay==1.2.0
Using cached sbvirtualdisplay-1.2.0-py2.py3-none-any.whl (13 kB)
Collecting SecretStorage==3.3.3
Using cached SecretStorage-3.3.3-py3-none-any.whl (15 kB)
Collecting selenium==4.10.0
Using cached selenium-4.10.0-py3-none-any.whl (6.7 MB)
Collecting seleniumbase==4.15.3
Using cached seleniumbase-4.15.3-py3-none-any.whl (526 kB)
Collecting six==1.16.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting sniffio==1.3.0
Using cached sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting sortedcontainers==2.4.0
Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting soupsieve==2.4.1
Using cached soupsieve-2.4.1-py3-none-any.whl (36 kB)
Collecting tabcompleter==1.2.0
Using cached tabcompleter-1.2.0-py3-none-any.whl (6.7 kB)
Collecting tomli==2.0.1
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting tqdm==4.65.0
Using cached tqdm-4.65.0-py3-none-any.whl (77 kB)
Collecting trio==0.22.0
Using cached trio-0.22.0-py3-none-any.whl (384 kB)
Collecting trio-websocket==0.10.2
Using cached trio_websocket-0.10.2-py3-none-any.whl (17 kB)
Collecting undetected-chromedriver==3.4.6
Using cached undetected-chromedriver-3.4.6.tar.gz (61 kB)
Preparing metadata (setup.py) ... done
Collecting urllib3==1.26.15
Using cached urllib3-1.26.15-py2.py3-none-any.whl (140 kB)
Collecting websockets==11.0.2
Using cached websockets-11.0.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)
Collecting wsproto==1.2.0
Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting zipp==3.15.0
Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting zstandard==0.21.0
Using cached zstandard-0.21.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB)
Collecting urllib3[socks]<3,>=1.26
Using cached urllib3-2.0.4-py3-none-any.whl (123 kB)
INFO: pip is looking at multiple versions of selenium to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of secretstorage to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of sbvirtualdisplay to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of rich to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of requests-toolbelt to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyyaml to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-xdist to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-rerunfailures to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-ordering to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-metadata to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-html to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest-forked to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pytest to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pysocks to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyrsistent to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyparsing to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyotp to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyopenssl to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pynose to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pygments to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pycparser to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pyasn1 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of py to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pluggy to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of platformdirs to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of pdbp to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of parse-type to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of parse to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of parameterized to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of packaging to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of outcome to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of notifiers to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of more-itertools to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of mdurl to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of markdown-it-py to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of loguru to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of keyring to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of kaitaistruct to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of jsonschema to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of jeepney to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of jaraco-classes to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of iniconfig to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of importlib-metadata to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of idna to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of hyperframe to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of hpack to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of h2 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of h11 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of filelock to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of fasteners to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of execnet to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of exceptiongroup to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of darkdetect to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of customtkinter to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of cssselect to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of cryptography to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of colorama to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of click to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of charset-normalizer to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of chardet to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of cffi to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of certifi to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of brotli to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of blinker to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of behave to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of beautifulsoup4 to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of attrs to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of async-generator to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install -r requirements.txt (line 69), -r requirements.txt (line 70) and trio-websocket==0.10.2 because these package versions have conflicting dependencies.

The conflict is caused by:
The user requested trio-websocket==0.10.2
selenium 4.10.0 depends on trio-websocket~=0.9
seleniumbase 4.15.3 depends on trio-websocket==0.10.3; python_version >= "3.7"

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflict

Переодическая ошибка

Переодически вылетает такая ошибка, но парсер продолжает работать. Это на что нибудь аффектит?

An error has been caught in function '__paginator', process 'MainProcess' (1367571), thread 'MainThread' (140401577594880):
Traceback (most recent call last):

  File "/home/ksv2/rep/parser_avito/parser_cls.py", line 319, in <module>
    ).parse()

  File "/home/ksv2/rep/parser_avito/parser_cls.py", line 271, in parse
    self.__paginator()
    -> <__main__.AvitoParse object at 0x7fb1c7840e80>

> File "/home/ksv2/rep/parser_avito/parser_cls.py", line 54, in __paginator
    self.__parse_page()
    -> <__main__.AvitoParse object at 0x7fb1c7840e80>

  File "/home/ksv2/rep/parser_avito/parser_cls.py", line 90, in __parse_page
    price = title.find_element(*LocatorAvito.PRICE).get_attribute("content")
            |     |             |            -> ('css selector', "[itemprop='price']")
            |     |             -> <class 'locator.LocatorAvito'>
            |     -> <function WebElement.find_element at 0x7fb1c8200280>
            -> <seleniumbase.undetected.webelement.WebElement (session="3481221ffeba998e119a3899a019110d", element="3EA081E033BECD52D45F3529...

  File "/home/ksv2/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 178, in get_attribute
    attribute_value = self.parent.execute_script(
                      |    -> <property object at 0x7fb1c82124d0>
                      -> <seleniumbase.undetected.webelement.WebElement (session="3481221ffeba998e119a3899a019110d", element="3EA081E033BECD52D45F3529...
  File "/home/ksv2/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 408, in execute_script
    return self.execute(command, {"script": script, "args": converted_args})["value"]
           |    |       |                   |               -> [<seleniumbase.undetected.webelement.WebElement (session="3481221ffeba998e119a3899a019110d", element="3EA081E033BECD52D45F352...
           |    |       |                   -> '/* getAttribute */return (function(){return (function(){var h=this||self;function aa(a){return"string"==typeof a}function ba...
           |    |       -> 'w3cExecuteScript'
           |    -> <function WebDriver.execute at 0x7fb1c8202b90>
           -> <seleniumbase.undetected.Chrome (session="3481221ffeba998e119a3899a019110d")>
  File "/home/ksv2/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
    self.error_handler.check_response(response)
    |    |             |              -> {'status': 500, 'value': '{"value":{"error":"script timeout","message":"script timeout\\n  (Session info: chrome=121.0.6167.1...
    |    |             -> <function ErrorHandler.check_response at 0x7fb1c81f1870>
    |    -> <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fb1c7939030>
    -> <seleniumbase.undetected.Chrome (session="3481221ffeba998e119a3899a019110d")>
  File "/home/ksv2/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
          |               |        |       -> ['#0 0x56022ba88d93 <unknown>', '#1 0x56022b76c177 <unknown>', '#2 0x56022b7fa184 <unknown>', '#3 0x56022b7da442 <unknown>', ...
          |               |        -> None
          |               -> 'script timeout\n  (Session info: chrome=121.0.6167.139)'
          -> <class 'selenium.common.exceptions.TimeoutException'>

selenium.common.exceptions.TimeoutException: Message: script timeout
  (Session info: chrome=121.0.6167.139)
Stacktrace:
#0 0x56022ba88d93 <unknown>
#1 0x56022b76c177 <unknown>
#2 0x56022b7fa184 <unknown>
#3 0x56022b7da442 <unknown>
#4 0x56022b7f912d <unknown>
#5 0x56022b7da1e3 <unknown>
#6 0x56022b7aa135 <unknown>
#7 0x56022b7ab13e <unknown>
#8 0x56022ba4ce4b <unknown>
#9 0x56022ba50dfa <unknown>
#10 0x56022ba396d5 <unknown>
#11 0x56022ba51a6f <unknown>
#12 0x56022ba1d69f <unknown>
#13 0x56022ba76098 <unknown>
#14 0x56022ba76262 <unknown>
#15 0x56022ba87f34 <unknown>
#16 0x7f32ece94ac3 <unknown>

Выдает 2 ошибки в parser_cls

добрый день.
если запускать через AvitoParser то показывает:
2023-06-04 03:39:36.959 | INFO | main:logger_widget_init:230 - Запуск AvitoParser
2023-06-04 03:39:36.964 | INFO | main:logger_widget_init:231 - Чтобы начать работу, проверьте, чтобы поле URL было заполненными, остальное на Ваше усмотрение. Нужна помощь - нажмите на ссылку внизу окна.
2023-06-04 03:39:36.994 | INFO | main:logger_widget_init:233 - Удачного поиска !!!
2023-06-04 03:39:46.137 | INFO | main:start_scraping:139 - Начинаем поиск
2023-06-04 03:39:46.164 | ERROR | parser_cls:parse:254 - Ошибка: '<' not supported between instances of 'str' and 'int'
Exception in thread Thread-1 (start_scraping):
Traceback (most recent call last):
File "C:\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Python\Python311\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\79537\Desktop\ollpython\авито парсер\AvitoParser.py", line 150, in start_scraping
self.run_parse()
File "C:\Users\79537\Desktop\ollpython\авито парсер\AvitoParser.py", line 255, in run_parse
).parse()
^^^^^^^
File "C:\Users\79537\Desktop\ollpython\авито парсер\parser_cls.py", line 256, in parse
self.driver.quit()
^^^^^^^^^^^
AttributeError: 'AvitoParse' object has no attribute 'driver'

если parser_cls запускаю:
2023-06-04 03:51:01.054 | ERROR | main:parse:254 - Ошибка: '<' not supported between instances of 'str' and 'int'
2023-06-04 03:51:01.054 | ERROR | main::296 - 'AvitoParse' object has no attribute 'driver'
2023-06-04 03:51:01.055 | ERROR | main::297 - Произошла ошибка, но работа будет продолжена через 30 сек. Если ошибка повторится несколько раз - перезапустите скрипт.Если и это не поможет - обратитесь к разработчику
по ошибке int-str сравнение на 121-127 строчке мин-мах прайс с прайсом взятым с авито но там все в str переведено больше не где не нашел.
по драйверу тоже вроде все прописано.
снес установил все заново - тоже самое.

Ошибка "FileNotFoundError: [Errno 2] No such file or directory: 'viewed.txt'"

Запустил скрипт. Работал 2 часа и начал выводить ошибку FileNotFoundError: [Errno 2] No such file or directory: 'viewed.txt'. В самой папке существует этот файл 'viewed.txt'. Более подробная ошибка:
An error has been caught in function '__paginator', process 'MainProcess' (17405), thread 'MainThread' (140189986992128):
Traceback (most recent call last):

File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 193, in
).parse()

File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 156, in parse
self.__paginator()
-> <main.AvitoParse object at 0x7f8084d2fe20>

File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 74, in __paginator
self.__parse_page()
-> <main.AvitoParse object at 0x7f8084d2fe20>

File "/root/parser_avito-master/parser_avito-master/parser_cls.py", line 87, in __parse_page
with open('viewed.txt', 'r') as file:

FileNotFoundError: [Errno 2] No such file or directory: 'viewed.txt'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.