I am using Selenium Chrome Webdriver to open a webpage in Python 3.
I would like to have a function that can open the webpage.
I originally had:
driver = webdriver.Chrome(executable_path=r'C:UsersaliceDesktopchromedriver')
driver.get('https://reports.blm.gov/report/LR2000/23/Pub-MC-Geo-Index')
I put it in to a function goTo()
def goTo():
driver = webdriver.Chrome(executable_path=r'C:UsersaliceDesktopchromedriver')
driver.get('https://reports.blm.gov/report/LR2000/23/Pub-MC-Geo-Index')
However, I was unable to do any other action on that page outside of that goTo function. When try I get error:
WebDriverException: chrome not reachable
(Session info: chrome=65.0.3325.181)
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.16299 x86_64)
Does anyone knows how can I open the a page properly using a function?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…