Python Selenium: как открыть веб-страницу, уже вошедшую в системуPython

Программы на Python
Anonymous
Python Selenium: как открыть веб-страницу, уже вошедшую в систему

Сообщение Anonymous »


I know this has been asked before but I've gone through countless posts and still can't get to work. I'm trying to open a webpage using my existing chrome profile/user data in order to avoid having to login. Ideally I'd like to do this in a new window that I can later close and not affect any other open Chrome pages. Whatever I try opens a new window that is not logged into Chrome nor the website. Please help!
from selenium import webdriver from selenium.webdriver.chrome.service import Service path = Service(r"C:/...chromedriver.exe") #path to chromedriver options = webdriver.ChromeOptions() options.add_argument(r"--user-date-dir=C:/Users/*username*/AppData/Local/Google/Chrome/User Data") options.add_argument(r"--profile-directory=*profilename*") options.add_argument('--no-sandbox') options.add_argument('--disable-gpu') options.add_experimental_option('excludeSwitches', ['enable-logging']) browser = webdriver.Chrome(service=path, options=options) url = "https://..." browser.get(url)

Источник: https://stackoverflow.com/questions/777 ... -logged-in

Вернуться в «Python»