LINUX.ORG.RU

Скрипт не видит chromedriver

 


0

1

Устанавливаю вот эту прелесть https://github.com/essandess/isp-data-pollution/ (на ноуте работало). После установки всех зависимостей выдает вот это:

This is ISP Data Pollution 🐙💨, Version 2.0.1
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/common/service.py", line 71, in start
    self.process = subprocess.Popen(cmd, env=self.env,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/artem/isp-data-pollution/isp_data_pollution.py", line 1131, in <module>
    ISPDataPollution()
  File "/home/artem/isp-data-pollution/isp_data_pollution.py", line 243, in __init__
    self.check_chromedriver_version()
  File "/home/artem/isp-data-pollution/isp_data_pollution.py", line 274, in check_chromedriver_version
    self.open_driver()
  File "/home/artem/isp-data-pollution/isp_data_pollution.py", line 302, in open_driver
    driver = webdriver.Chrome(options=chrome_options)
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/chromium/webdriver.py", line 90, in __init__
    self.service.start()
  File "/usr/local/lib/python3.9/dist-packages/selenium/webdriver/common/service.py", line 81, in start
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

Я как бы понимаю, что какая-то фигня с chromedriver, но как это исправить - не знаю. Есть идеи?



Последнее исправление: Zhbert (всего исправлений: 1)

А зачем в тегах Python2?

th3m3 ★★★★★
()

Message: ‘chromedriver’ executable needs to be in PATH.

Скачай хромдрайвер, положи его в каталог, который есть в $PATH.

Zhbert ★★★★★
()

Либо добавь директорию в PATH по индустки

import sys sys.path.insert(0,'/path/to/mod_directory')
IIIypuk ★★★
()
Ответ на: комментарий от Zhbert

Окей, положил в usr/local/bin. Теперь вот это:

This is ISP Data Pollution 🐙💨, Version 2.0.1 Traceback (most recent call last): File «/home/artem/isp-data-pollution/isp_data_pollution.py», line 1131, in ISPDataPollution() File «/home/artem/isp-data-pollution/isp_data_pollution.py», line 243, in init self.check_chromedriver_version() File «/home/artem/isp-data-pollution/isp_data_pollution.py», line 274, in check_chromedriver_version self.open_driver() File «/home/artem/isp-data-pollution/isp_data_pollution.py», line 302, in open_driver driver = webdriver.Chrome(options=chrome_options) File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/chrome/webdriver.py», line 70, in init super(WebDriver, self).init(DesiredCapabilities.CHROME[‘browserName’], «goog», File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/chromium/webdriver.py», line 93, in init RemoteWebDriver.init( File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py», line 269, in init self.start_session(capabilities, browser_profile) File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py», line 360, in start_session response = self.execute(Command.NEW_SESSION, parameters) File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/webdriver.py», line 425, in execute self.error_handler.check_response(response) File «/usr/local/lib/python3.9/dist-packages/selenium/webdriver/remote/errorhandler.py», line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary Stacktrace: #0 0x560311d22543 #1 0x560311a7f5e8 #2 0x560311aa072d #3 0x560311a9defa #4 0x560311ad8f7a #5 0x560311ad30a3 #6 0x560311aa89ba #7 0x560311aa9b15 #8 0x560311d66d5d #9 0x560311d6a6dc #10 0x560311d510be #11 0x560311d6b338 #12 0x560311d46060 #13 0x560311d87758 #14 0x560311d878d8 #15 0x560311da16bd #16 0x7f5cf62fcea7

Требуется еще установить хром. Браузер? В смысле, куда его засунуть то? Тоже в директорию PATH?

Mr_Hydus
() автор топика
Ответ на: комментарий от Mr_Hydus

У тебя Хром в системе установлен?

gruy ★★★★★
()
Ответ на: комментарий от Mr_Hydus

Ну ты бы хоть погуглил, что это за хромдрайвер такой, и для чего он нужен.

Zhbert ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.