I have a working Python script on Windows using Selenium 3.141.0. When I switch to Selenium 4.9.1, I get the following error:
selenium.common.exceptions.WebDriverException: Message: <!-- IE friendly error message walkround.
E if error message from server is less than
E 512 bytes IE v5+ will use its own error
E message instead of the one returned by
E server. -->
... bunch of html/css tags ...
E <div class="logo"></div>
E <h1>504 DNS look up failed</h1>
E <p>The webserver reported that an error occurred while trying to access the website. Please return to the previous page.</p>
E <table><tbody>
E <tr>
E <td>URL</td>
E <td>http://localhost:62789/session</td>
E </tr>
E </tbody></table>
For troubleshooting, I tried the simplest possible code where I tried various combinations of options and no options:
def test_chrome_sel4():
chrome_opts = webdriver.ChromeOptions()
chrome_opts.add_argument('--no-sandbox')
#chrome_opts.add_argument("--headless")
chrome_opts.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=chrome_opts)
driver.get("https://www.google.com")
sleep(4)
driver.quit()
From the output, it shows the use of the driver, and if I delete the driver, the code downloads it, so that part is working.
From Selenium 3 to 4, I made changes to use the new Service mechanism for creating the driver. Is there something else that is not backward compatible to Selenium 3?