0

I'm using webdriver-manager for managing chrome drivers as follows:

# selenium 4
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromiumService
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType

driver = webdriver.Chrome(service=ChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))
driver.get('http://localhost:1234')

It seems initially to work and the browser spawns a window, but it remain on data:, tab and the driver.get doesn't work. Anyone faced the same problem?

5.19.0-38-generic #39~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 17 21:16:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

chromium installed version: 112.0.5615.49 (Official build) snap (a 64 bit)

From snap.

Installed pip dependencies:

webdriver-manager
selenium
Virgula
  • 318
  • 4
  • 12

1 Answers1

0

You don't need WebDriverManager any more if you are using selenium v4.6.0 or above. With v4.6.0 selenium has introduced Selenium Manager. Essentially SeleniumManager will do the job of managing drivers for you.

You can replace the below line:

driver = webdriver.Chrome(service=ChromiumService(ChromeDriverManager(chrome_type=ChromeType.CHROMIUM).install()))

To:

driver = webdriver.Chrome()

UPDATE: If you are specific about using WebDriverManager, my hunch is that you are using selenium v4.8.1 or lower, if yes, just update your selenium to v4.8.3

Shawn
  • 4,064
  • 2
  • 11
  • 23