A
A
agent_22032020-10-13 18:53:07
Python
agent_2203, 2020-10-13 18:53:07

How to manage firefox extension in selenium?

Installed via selenium extension to use proxy, but I don't know how to connect now. Nobody knows how to manage extensions through selenium ?

Installed like this

firefox_binary = '/usr/bin/firefox-developer-edition'
driver = webdriver.Firefox(firefox_binary=firefox_binary)
driver.install_addon("/home/foxyproxy.xpi", temporary=True)

driver.close()
driver.quit()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2020-10-13
@agent_2203

Through selenium - no way.
Proxy with password can be used by installing selenium-wire
pip install selenium-wire
Use like this:

from seleniumwire import webdriver
options = {
'proxy': {
    'http': 'http://username:[email protected]:port',
    'https': 'https://username:[email protected]:port',
    'no_proxy': 'localhost,127.0.0.1,dev_server:8080'
    }
}
driver = webdriver.Firefox(seleniumwire_options=options)

Source: https://stackoverflow.com/a/59288186
Plan B:
Tweak this extension's sqlite database in the user's profile. Proxy settings are stored there in binary form, but the format is simple, at first glance

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question