T
T
Tula Electronic Samovar2021-12-30 22:06:40
Python
Tula Electronic Samovar, 2021-12-30 22:06:40

How to use portable version of Chrome with selenium in Python?

Is it possible to somehow use it together with the Selenium Chrome driver, which is not installed on the system, but simply copied?
It is necessary in order to save different settings in different profiles.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2021-12-30
@vcomp71

It is necessary in order to save different settings in different profiles.

Maybe it's better to specify the necessary profiles when starting the script?:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument("user-data-dir=./SeleniumProfile")
driver = webdriver.Chrome(chrome_options=options)
driver.get("https://google.com")

And this is how you can specify the path to chrome (only replace the paths with your own). options.binary_location = './chrome/chrome'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question