Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to set firefox profile path? #3316

Answered by mdmintz
bshsbr asked this question in Q&A
Discussion options

user_data_dir only works on chrome,
but what about firefox?
how to set firefox profile path?
with SB(browser="firefox", user_data_dir=r"Profiles\ultibot") as sb:

You must be logged in to vote

If there's a way to set a Firefox Profile, then it would be done via firefox_arg or firefox_pref:

 firefox_arg=FIREFOX_ARG,
 Add a Firefox argument for Firefox browser runs.
 Format: A comma-separated list of Firefox args.
 firefox_pref=FIREFOX_PREF,
 Set a Firefox preference:value combination.
 Format: A comma-separated list of pref:value items.
 Example usage:
 firefox_pref="browser.formfill.enable:True"
 Boolean and integer values to the right of the ":"
 will be automatically converted into proper format.
 If there's no ":" in the string, then True is used.

Replies: 1 comment 1 reply

Comment options

If there's a way to set a Firefox Profile, then it would be done via firefox_arg or firefox_pref:

 firefox_arg=FIREFOX_ARG,
 Add a Firefox argument for Firefox browser runs.
 Format: A comma-separated list of Firefox args.
 firefox_pref=FIREFOX_PREF,
 Set a Firefox preference:value combination.
 Format: A comma-separated list of pref:value items.
 Example usage:
 firefox_pref="browser.formfill.enable:True"
 Boolean and integer values to the right of the ":"
 will be automatically converted into proper format.
 If there's no ":" in the string, then True is used.
firefox_arg (str): "ARG=N,ARG2" (Set Firefox args, comma-separated.)
firefox_pref (str): SET (Set Firefox PREFERENCE:VALUE set, ","-separated)
You must be logged in to vote
1 reply
Comment options

Thanks, it helped!
I used this syntax:
with SB(browser="firefox", firefox_arg=fr"--profile={profile_path}") as driver:
but now I'm getting read timeout error, for some reason geckodriver and firefox can't connect to each other:

HTTPConnectionPool(host='localhost', port=9106): Read timed out. (read timeout=120)
TimeoutError: timed out
Answer selected by bshsbr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /