pythonpython-3.xseleniumselenium-chromedrivervivaldi

How to initiate a Chromium based Vivaldi browser session using Selenium and Python


I am trying to use the vivaldi browser with Selenium. It is a chromium browser that runs very similar to chrome. I have Selenium working with Firefox (geckodriver), and Google Chrome(chromedriver), but I can't seem to find a way with Vivaldi. Any help would be appreciated.


Solution

  • If the vivaldi binary by default is located at C:\Users\levir\AppData\Local\Vivaldi\Application\vivaldi.exe you can use the following solution:

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    
    options = Options()
    options.add_argument("start-maximized")
    options.binary_location=r'C:\Users\levir\AppData\Local\Vivaldi\Application\vivaldi.exe'
    driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', options=options)
    driver.get('http://google.com/')