M
M
Maxim Shelkov2020-05-22 17:17:45
Python
Maxim Shelkov, 2020-05-22 17:17:45

Loading user profile when opening Chrome?

Good afternoon, there was a problem when opening the test browser Chrome (Selenium WebDriver), I can not enter the profile created earlier.

Code
from selenium import webdriver
from selenium.webdriver.chrome.options import Options


class Add_to_cart(object):

    #driver ='C:/chromebot/driver/chromedriver.exe'

    #def __init__(self, size):
        #self.driver = driver
    
    def ChromeOptions(self):
        options = webdriver.ChromeOptions()
        #options = Options()
        options.add_argument("user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1")
        driver = webdriver.Chrome(executable_path = r'C:/chromebot/driver/chromedriver.exe', chrome_options = options)
        driver.get("chrome://version/")
a = Add_to_cart()
a.ChromeOptions()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-05-22
@dimonchik2013

use firefox
or check permissions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question