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:\Users\alice\Desktop\chromedriver')
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:\Users\alice\Desktop\chromedriver')
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?
The error says it all :
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)
Your main issue is the version compatibility between the binaries you are using as follows :
Supports Chrome v62-64
Supports Chrome v64-66
So there is a clear mismatch between the ChromeDriver version (v2.35) and the Chrome Browser version (v65.0)
@Test
.driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With