Reputation: 1
I wrote this:
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
driver = webdriver.Chrome("D:\01_Jan\Chromedriver\chromedriver.exe")
driver.get('https://www.caseking.de/asus-geforce-rtx-3070-ekwb-8g-8192-mb-gddr6-gcas-430.html?__cf_chl_jschl_tk__=3cc7dd10a046b37a91fb7442f67d7ae567894c63-1617776732-0-AXx4q2kIFylIaJSzZgO0fhK5spbXk1-Z576z2JLy3LVMU1OsY0QI8qDP0wdoL4ZAU8TFMMKqEm_H6ZkIIXBasbtpmT29tQr5WBaWo40n9jUiUpzTbmSfisq061bqribf1AuvWlXzx77xKhIX0UMPPnfznvKbQ-fGGM9H6OxX2GeHRkrsbWeIgW9Q-4Z5DgX-5GqqStAbcZP-JlkXsXS9b9AZ2HAKLGiqyiir3pFwfyP-OImwuvG9jrbmDwTQADEe8zuWMzTuKNCYyPQnGC7BmXxjrV5hMnzD5ly15IaXw_s81qlTzafaSO3Mst258F5VnHSkCNwN32frijhm-jyguObin6vIVdFsKnITJzmmxvW9vkrI6zlGPtGyZyOgxOV_GD5XNlw8Pe2OqmoQsY9uiPfozWjSzyJZLw4AIUeQPetxTQNFUKNbcmFYQJvoSuFc21j82l5cYQyGGWNPSzcPOa4JDvCSe8Eco3H1AhPt30XGx_965Njhq9mYsIDfUqDpk13FEmotoMnFZdK5F5rW_W0')
And I am getting the following Error:
Traceback (most recent call last): File "C:\Users\atrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\atrei\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\atrei\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "Bot.py", line 8, in driver = webdriver.Chrome("D:\01_Jan\Chromedriver\chromedriver.exe") File "C:\Users\atrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\atrei\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Thanks for help
Upvotes: 0
Views: 1807
Reputation: 3543
Try using webdriver-manager:
pip install webdriver-manager
what I prefer mostly and use it like:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())
it will install driver and store automatically in suited path
Upvotes: 1