Code:
from selenium import webdriver driver = webdriver.Chrome() Mistake:
C:/Users/user/PycharmProjects/learn_python/sel.py Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in __init__ restore_signals, start_new_session) File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child startupinfo) FileNotFoundError: [WinError 2] Не удается найти указанный файл During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/user/PycharmProjects/learn_python/sel.py", line 2, in <module> driver = webdriver.Chrome() File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 62, in __init__ self.service.start() File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x004FE1F0>> Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 173, in __del__ self.stop() File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 145, in stop if self.process is None: AttributeError: 'Service' object has no attribute 'process' What's the matter?
driver = webdriver.Chrome(executable_path=r"C:\Chrome\chromedriver.exe")- try this by specifying your path tochromedriver.exe- Anton Komyshan