My configuration: OS Windows 10, Chrome 103.0, Webdriver 3.8.2, Selenium 4.3.0, Python 3.10.5.
I am learning to use Python Selenium framework. My goal is to automate some repetitive tasks that I perform on a web application inside my intranet. The webapp requests authentication, but as long as I am logged in the Windows domain, the browser recognizes it and automatically does login.
I tried the following snippet of code (TARGET_URL being the url of the page I want to reach):
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
driver.get(TARGET_URL)
I have two different results in different scenarios:
remote working: laptop connected to the intranet via VPN. In this case all works well: the Chrome browser is launched and the requested page is opened. I can access the contents via
page_source
attribute and viafind_element
method.working in the office: desktop PC connected to the LAN via Ethernet, so directly into the intranet. In this case I receive a long error message (VS Code says "Output exceeds the size limit. Open the full output data in a text editor"), however the last lines are:
Max retries exceeded with url: /103.0.5060/chromedriver_win32.zip (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002719EE6F3A0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Looking for similar threads, I found this one SSL Certificate Verification Failed - When using WebDriverManager in Python Selenium framework and tried the solution n.2, i.e. disable SSL verification in WebDriverManager, but without success.
Is there any other way to get the browser open by Selenium, or at least some plausible reasons for the different behaviours?