Всем привет!
Начал разбираться с Selenium. Ввел:
import time
from selenium import webdriver
driver = webdriver.Chrome(r'C:\Users\Igor\Bin\chromedriver.exe')
# driver = webdriver.Firefox(r'C:\Users\Igor\Bin\geckodriver.exe')
driver.maximize_window()
driver.get('http://www.google.com/')
time.sleep(15)
driver.quit()
В Chrome выдает такие ошибки:
Traceback (most recent call last):
File "C:/Users/Igor/PycharmProjects/parser_01/parser_02.py", line 4, in <module>
driver = webdriver.Chrome(r'C:\Users\Igor\Bin\chromedriver.exe')
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
desired_capabilities=desired_capabilities)
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist
В Firefox - такие:
Traceback (most recent call last):
File "C:/Users/Igor/PycharmProjects/parser_01/parser_02.py", line 5, in <module>
driver = webdriver.Firefox(r'C:\Users\Igor\Bin\geckodriver.exe')
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 151, in __init__
firefox_profile = FirefoxProfile(firefox_profile)
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\firefox\firefox_profile.py", line 80, in __init__
ignore=shutil.ignore_patterns("parent.lock", "lock", ".parentlock"))
File "C:\Users\Igor\AppData\Local\Programs\Python\Python37\lib\shutil.py", line 318, in copytree
names = os.listdir(src)
NotADirectoryError: [WinError 267] Неверно задано имя папки: 'C:\\Users\\Igor\\Bin\\geckodriver.exe'
В PATH путь прописан. Чего ему не хватает?