How to enable firefox extensions in Selenium?

Asked

Viewed 16 times

1

I installed an extension in firefox but when Selenium opens firefox it starts without the extension, is there any way that Selenium can start firefox with the extension that is installed or make it "install" the extension on start? I’m using the Selenium library for python

options = Options()
self.browser = webdriver.Firefox(options=options)
url = 'https://www.google.com/'
self.browser.get(url.lower())

2 answers

1

1

I managed to find out, to add a firefox extension in Python Selenium is like this:

options = Options()
browser = webdriver.Firefox(options=options)   
browser.install_addon('caminho do arquivo .xpi')
browser.get('...')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.