2

Ошибка

File "C:\Users\milky\PycharmProjects\pythonProject2\venv\lib\site- 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://sites.google.com/a/chromium.org/chromedriver/home

Код

from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://www.sport-express.ru/hockey/khl/news/')

1 ответ 1

1

Import

from pathlib import Path

Code

BASE_DIR = Path(__file__).resolve().parent.parent
pathToChromeDriver = f'{BASE_DIR}/chromedriver.exe'
driver = webdriver.Chrome(pathToChromeDriver)

И закинь chromedriver в корень проекта

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.