DEV Community

abbazs
abbazs

Posted on • Edited on

6 3

How to launch google-chrome with a specific profile using selenium (python)?

from selenium import webdriver
from selenium.webdriver import ChromeOptions
opts = ChromeOptions()
opts.arguments.append('--profile-directory=Profile 2')
opts.arguments.append(
'--user-data-dir=/home/user_directory/.config/google-chrome/'
)
# In this case the driver is saved in the
# current directory under a folder named driver
driver = webdriver.Chrome(
executable_path="./driver/chromedriver", 
options=opts)
Enter fullscreen mode Exit fullscreen mode

Selenium will throw exception InvalidArgumentException: Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir if the argument --user-data-dir is passed with a / at the end of the argument input if the directory already exits, else selenium will not throw exception.

Selenium will still throw an InvalidArgumentException

Image of AssemblyAI tool

Challenge Submission: SpeechCraft - AI-Powered Speech Analysis for Better Communication

SpeechCraft is an advanced real-time speech analytics platform that transforms spoken words into actionable insights. Using cutting-edge AI technology from AssemblyAI, it provides instant transcription while analyzing multiple dimensions of speech performance.

Read full post

Top comments (0)

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay