an error log might be helpful but i think you should specify the path to the chromedriver.exe
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from time import sleep
chromedriver_path = './chromedriver.exe'
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options, executable_path=chromedriver_path)
driver.get("http://www.google.com")
sleep(3) driver.quit()
'./chromedriver.exe'
means chromedriver is in the project root folder and you can add options to chromedriver such as
options.add_argument("--disable-blink-features")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
to avoid getting detected as a bot
so it would be like this
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from time import sleep
chromedriver_path = './chromedriver.exe'
options = webdriver.ChromeOptions()
options.add_argument("--disable-blink-features")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options, executable_path=chromedriver_path)
driver.get("http://www.google.com")
sleep(3) driver.quit()