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.
2
Answers
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).
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.
Should get you the Chromium driver, and they have some example code there that doesn’t look too outdated.