from selenium import webdriver from selenium.webdriver.chrome import service from selenium.webdriver.common.alert import Alert import time #ChromeDriverのパスを変数に設定 CHROMEDRIVER = "D:\driver\chromedriver.exe" #ChromeDriverのstartとstopを制御するServiceオブジェクトを介してパスを渡す chrome_service = service.Service(executable_path=CHROMEDRIVER) #Chromeを起動 driver = webdriver.Chrome(service=chrome_service) #指定したURLに遷移<図1> dr