Загрузка профиля пользователя при открытии Chrome?
возникла проблема при открытии тестового браузера Chrome(Selenium WebDriver), не могу войти в профиль созданный ранее.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import time
from selenium.common.exceptions import ElementNotInteractableException
class Add_to_cart(object):
def AddProductToBasket(self):
options = webdriver.ChromeOptions()
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("https://www.nike.com/ru/t/ссылка")
#a = driver.find_elements_by_xpath("//label[contains(text(), 'US 10 (RU 43)')]")
try:
driver.find_element_by_xpath("//label[contains(text(), 'US 11 (RU 44)')]").click()
driver.find_element_by_class_name('ncss-btn-primary-dark').click()
driver.find_element_by_class_name('cart-button').click()
driver.get('https://www.nike.com/ru/ru/cart')
except ElementNotInteractableException:
driver.find_element_by_xpath("//label[contains(text(), 'US 10.5 (RU 43,5)')]").click()
driver.find_element_by_class_name('ncss-btn-primary-dark').click()
driver.find_element_by_class_name('cart-button').click()
driver.get('https://www.nike.com/ru/ru/cart')
time.sleep(3600)
#options = Options()
#options.add_argument("user-data-dir=C:\\Users\\User\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 40")
#driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', chrome_options=options)
#driver.get("https://www.google.co.in")
a = Add_to_cart()
a.AddProductToBasket()