0

I want to open grammarly without entering the user id and password. So in selenium when I open then it starts as complete new browser without my passwords saved. So I want to know how to open browser which has all my passwords saved. Please tell with respect to python and chrome browser.

1 Answers1

0

Export your Chrome user profile and locate it stored in C:\Users\Your_User\AppData\Local\Google\Chrome\User Data

Add user-data-dir argument to chromedriver declaration using the file path to the user data you exported.

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

options = Options()
options.add_argument("user-data-dir=C:\\Users\Your_User\\AppData\\Local\\Google\\Chrome\\User Data\\My_Profile")

driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', chrome_options=options)

This might not work for autocompleting forms like you expect but it will start Chrome with your personal profile.

CEH
  • 5,701
  • 2
  • 16
  • 40