Skip to content

Instantly share code, notes, and snippets.

@SurendraTamang
Created April 13, 2021 06:12
Show Gist options
  • Save SurendraTamang/31276d277f7c04ecd8b4cefc74de74b7 to your computer and use it in GitHub Desktop.
Save SurendraTamang/31276d277f7c04ecd8b4cefc74de74b7 to your computer and use it in GitHub Desktop.
Adding profile in browser can help us to get rid of login every in browser.
'''This script will help us to add the profile on our Chrome Driver and hence
we can add the profile
'''
# Open the browser and Goto the profile we want file
# Navigate to the chrome://version/ to see the Profile Path
# THis is my defaule
USER_DATA_PATH = 'C:\\Users\\{Our_User_Name of PC}\\AppData\\Local\\Google\\Chrome\\User Data'
PROFILE_DIRECTORY = 'Profile 6'
options = webdriver.ChromeOptions()
options.add_argument(f'--user-data-dir={USER_DATA_PATH}')
options.add_argument(f'--profile-directory={PROFILE_DIRECTORY}')
driver = webdriver.Chrome(executable_path="C:\\Users\\Vision\\Downloads\\chromedriver_win32\\chromedriver.exe", options=options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment