- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to open chrome default profile with selenium?
We can open Chrome default profile with Selenium. To get the Chrome profile path, we need to input chrome://version/ in the Chrome browser and then press enter.
We need to use the ChromeOptions class to open the default Chrome profile. We need to use the add_argument method to specify the path of the Chrome profile.
Syntax
o = webdriver.ChromeOptions() o.add_argument = {'user-data-dir':'/Users/Application/Chrome/Default'}
Example
Code Implementation
from selenium import webdriver #object of ChromeOptions class o = webdriver.ChromeOptions() #adding Chrome Profile Path o.add_argument = {'user-data-dir':'/Users/Application/Chrome/Default'} #set chromedriver.exe path driver = webdriver.Chrome(executable_path="C:\chromedriver.exe", options=o) #maximize browser driver.maximize_window() #launch URL driver.get("https://www.tutorialspoint.com/index.htm") #get browser title print(driver.title) #quit browser driver.quit()
Output
- Related Articles
- How to use a specific chrome profile in selenium?
- How do I open Chrome in selenium WebDriver?
- How to set default download directory in selenium Chrome Capabilities?
- How to open a link in new tab of chrome browser using Selenium WebDriver?
- How to setup Chrome driver with Selenium on MacOS?
- How to invoke the Chrome browser in Selenium with python?
- How to mute all sounds in chrome webdriver with selenium?
- How to open any file with its default application with PowerShell?
- Downloading with chrome headless and selenium.
- How to launch Chrome Browser via Selenium?
- How to handle chrome notification in Selenium?
- How to avoid the pop-up window in chrome browser with Selenium?
- How to run Selenium WebDriver test cases in Chrome?
- How to programmatically configure Chrome extension through Selenium WebDriver?
- How to run Selenium tests on Chrome Browser using?

Advertisements