0

Consider:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

print("Hello, World!")

I am running Python 3.10 on Linux Ubuntu.

I was trying to play around with Selenium. However, any code that I write after defining the webdriver does not work.

It seems that the interpreter gets stuck after defining the webdriver. It opens the webdriver, but it only shows "data:," and nothing else and won't respond to any code written after.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

2 Answers2

0

I figured out the problem. I only had Chromium installed on my computer and I assumed that the Chromium drivers and the Chrome drivers are the same thing (I still can't find any reference to the Chromium drivers).

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

Chromium support is limited on Selenium in my experience.

Please look at the replies to this Stack Overflow question which do mention chromium-driver and how to get it.

 sudo apt-get install chromium-chromedriver

Should get you the Chromium driver, and they have some example code there that doesn't look too outdated.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
dot
  • 64
  • 7