Created
April 13, 2021 06:12
-
-
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''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