Forums

Selenium + Firefox: loading a firefox profile issue

Hello Everybody.

I am trying to run a selenium python script that uses firefox to do some actions. It works fine on my computer and I am using this command to run the script: xvfb-run python my_selenium_script.py

I am struggling finding a way to pass in my firefox profile when declaring the browser. It is an easy thing on my computer as I just pass in my profile when doing "browser = webdriver.Firefox(profile)" profile points to the firefox profile folder on my computer.

How can I replicate this on pythonanywhere? Should I upload my profile files to my pythonanywhere folder? Is there a better way to do this?

Thanks

Vittorio

You might be able to upload your profiles, but I'm not sure whether a Firefox profile created on one platform will work on another. I suspect you best bet is to create a new profile and set the specific preferences you need: https://www.seleniumeasy.com/selenium-tutorials/firefox-profile-preferences-using-selenium-webdriver

Thanks Glenn.

I'll try this path, it will actually be trickier (I believe) as what I need in the profile are my login details for the website that I am using selenium for.

I'll see if I can find something on this.

Thanks

Vittorio

Ok, but that seems like the wrong way to go about it. Is there a reason you're not just entering the auth details into the site?

Yes, you are right, I ended up doing that! Thanks

Cool