Issue
I got problem with load page by chromedriver in Selenium. After running the code , new tab opens but not load page.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
"""Parametry drivera"""
options = webdriver.ChromeOptions()
options.add_experimental_option("detach",True)
path = "C:/Users/10200385/Downloads/chrome-win64/chrome.exe"
service = Service(path)
driver = webdriver.Chrome(service=service,options=options)
driver.get("https://techwithtim.net")
print(driver.title)
driver.quit()
Solution
path = "C:/Users/10200385/Downloads/chrome-win64/chrome.exe"
service = Service(path)
Above code is not correct. You should set the path of browser driver(i.e. chromedriver.exe
), not the browser(chrome.exe
).
Change the code and set the path of chromedriver.exe
as below:
path = "C:/Users/<full path>/chromedriver.exe"
service = Service(path)
Having said the above, you don't really have to worry about setting the chromedriver.exe
path manually if you are using latest selenium. Check below answers to know more.
Answered By - Shawn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.