Selenium Webdriver configuration issues.

63 views
Skip to first unread message

Edward Markiewicz

unread,
Jun 20, 2024, 3:28:39 AM (13 days ago) Jun 20
to Selenium Users
I am new to Selenium and could use some guidance.  I need to know if I can set up Selenium to us a local version of chromedriver.exe and not look for the driver on the network.  When I run my script directly from my laptop from home it works fine.  But when I use VPN to connect to work and try to run the script, I get timeouts.  The timeout appears when I try to set the "driver" attribute.  My environment is:
  • Running on an HP laptop with Windows 11 installed.
  • I'm using Anaconda/Spyder as my IDE.
  • I am using Python 3.11.9.
  • I am using Selenium 4.21.0.
  • The simple training code I'm trying to run is:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

print('Try to install the webdriver.exe')
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))

print('Try to open a browser')
driver.get('https://google.com')

print('We B Done')


As I said I am brand new to Selenium and would like to know if I can point to a local version of chromedriver.exe I have downloaded to my laptop?  

~Ed

Edward Markiewicz

unread,
Jun 20, 2024, 9:54:10 AM (13 days ago) Jun 20
to Selenium Users
Update:  Looking for a solution I changed the " driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))" to simply "driver = webdriver.Chrome()".  It worked but it throws the following errors:

There was an error managing chromedriver (error sending request for url (https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json)); using driver found in the cache

Any ideas on how to clear the error?

~Ed

Edward Markiewicz

unread,
Jun 20, 2024, 10:45:11 AM (13 days ago) Jun 20
to Selenium Users
Update:  After running the code a few more times I saw this additional error:

Error sending stats to Plausible: error sending request for url (https://plausible.io/api/event)

~Ed

Edward Markiewicz

unread,
Jun 21, 2024, 8:21:10 PM (11 days ago) Jun 21
to Selenium Users
I found this solution on Google and it woprked for me.
  1. Copy the version of chromedriver.exe that I want to use to my Anaconda environment directory that I'm using.
  2. Change the "driver =" line in my original code to these 2 lines:
            cService = webdriver.ChromeService(executable_path='./chromedriver.exe')
            driver = webdriver.Chrome(service = cService)
And now everything runs with no errors or warnings.
~Ed
Reply all
Reply to author
Forward
0 new messages