Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 537
LeviR Avatar asked Jan 08 '20 11:01

LeviR


People also ask

Can you use Selenium with chromium?

Through WebDriver, Selenium supports all major browsers on the market such as Chrome/Chromium, Firefox, Internet Explorer, Edge, and Safari. Where possible, WebDriver drives the browser using the browser's built-in support for automation.

Can Selenium interact with an existing browser session Python?

To make Python Selenium interact with an existing browser session, we open the driver and the connect to the session with the given session ID.

How do I open Chrome in Selenium using Python?

We can open the Chrome browser with the help of the web driver package from the Selenium framework. To do this, we need to install python and import the selenium and web driver package.

Can we use Selenium to work with an already open browser session?

We can connect to an already open browser using Selenium webdriver. This can be done using the Capabilities and ChromeOptions classes. The Capabilities class obtains the browser capabilities with the help of the getCapabilities method.

How to use selenium with Vivaldi?

For future reference: to make Vivaldi work with selenium you need to make sure of three things : The correct version of ChromeDriver Set selenium's driver to use Vivaldi's binary via webdriver.ChromeOptions() Make sure you're getting the correct url (don't forget "https://")

Why doesn't Vivaldi use chromium for session management?

To make it such that each window was its own session, and support a persistent association between the windows & saved sessions, Vivaldi would need to completely scrap Chromium's existing session code and build it all from scratch. It's a different design paradigm and they're not compatible.

How to use selenium with chromium browser?

We can use Selenium with Chromium browser. Prior to working with Chrome with Selenium, we should have the Java JDK, a Java IDE and Selenium webdriver configured in our system. Then, we must download the chromodriver.exe file and set it up in our project with the below steps βˆ’

Is Vivaldi similar to Google Chrome?

We often get asked about the relationship between Vivaldi and Google Chrome. The truth is, while we rely on the Chromium engine (maintained by the Chromium project set up by Google), this is where similarities end. Let’s take a look. Vivaldi launched in 2015 to make up for the loss of features in other browsers.


1 Answers

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/')
like image 76
undetected Selenium Avatar answered Sep 20 '22 06:09

undetected Selenium