Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Selenium Chrone WebDriver object hangs in Docker on creation

$
0
0

Trying to initialize a Chrone WebDriver object inside a Docker container and then perform a get() method with a URL.

I have access to the web from docker (can ping www.google.com) and selenium is of latest version (4.16).

What happens, however, is that the moment webdriver.Chrome() gets called, it hangs. Simply hangs, infinitely, without any exceptions and errors.

Does anybody know what causes it and how to get past this problem?

Code I am trying to use below:

import selenium.webdriver.chrome.options as selenium_optionsfrom selenium import webdriveropts = selenium_options.Options()opts.add_argument('--disable-dev-shm-usage')opts.add_argument('--no-sandbox')opts.add_argument('--headless')driver = webdriver.Chrome(options = opts) # this hangs indifintely

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>