Home > Mobile >  no code runs after defining webdriver in selenium
no code runs after defining webdriver in selenium

Time:01-17

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")

running python 3.10 on linux ubuntu

I was trying to play aruond 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 only shows "data:," and nothing else and won't respond to any code written after.

CodePudding user response:

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(still can't find any refrence to the chromium drivers)

CodePudding user response:

Chromium support is limited on selenium in my experience.

Please look at the replies here which do mention chromium-driver and how to get it

 sudo apt-get install chromium-chromedriver

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

  • Related