Duff89 / parser_avito

Находит товары на avito.ru по ключевым словам
175 stars 63 forks source link

Ошибка chromedriver mac os #17

Closed Shiperoid closed 1 year ago

Shiperoid commented 1 year ago

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

Duff89 commented 1 year ago

У Вас установлен Chrome?

Shiperoid commented 1 year ago

У Вас установлен Chrome?

Нет, у меня сафари и опера

Duff89 commented 1 year ago

У Вас установлен Chrome?

Нет, у меня сафари и опера

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