Essentially the issue is when using seleniumwire version 5.1.0, and setting up the remote firefox webdriver to use selenium-wire's proxy, SW doesn't record the requests. I've tested setting the proxy to a separate mitmproxy instance, and the requests are going through the proxy, however they don't show up in seleniumwire. The requests do go through, as you can see in both the firefox GUI and through interactions with regular selenium methods.
Steps to Reproduce
setup a remote Selenium instance of firefox, I used docker with the following docker-compose
from seleniumwire import webdriver
from selenium.webdriver.common.proxy import Proxy
firefox_options = webdriver.FirefoxOptions()
sw_options = {
'auto_config': False, # Ensure this is set to False
'addr': '0.0.0.0', # The address the proxy will listen on
'port': 8087,
}
proxy = Proxy();
proxy.http_proxy = 'host.docker.internal:8087'
proxy.ssl_proxy = 'host.docker.internal:8087'
firefox_options.proxy = proxy
driver = webdriver.Remote(command_executor="http://localhost:4444/wd/hub",options=firefox_options, seleniumwire_options=sw_options)
driver.get("http://example.com")
print(driver.requests)
and observe that driver.requests is empty.
other notes
I've verified that the traffic is going through the proxy by
a) running mitmproxy, setting proxy.http_proxy and proxy.ssl_proxy to its address and observing that the requests appear there
b) vnc-ing into the firefox instance and going into the settings, observing that the proxy settings are set
c) the pages still show up int he firefox gui and can be interacted with normally with selenium
d) setting proxy.http_proxy and proxy.ssl_proxy to invalid addresses and observing that requests from firefox do not go through
the request are captured fine by the using the local firefox webdriver and the default configuration
So it turns out that this was an issue with my computer, I tried it again after restarting and it worked fine. sorry abt that. Thank you for all the work you do on Selenium-Wire!
Essentially the issue is when using seleniumwire version 5.1.0, and setting up the remote firefox webdriver to use selenium-wire's proxy, SW doesn't record the requests. I've tested setting the proxy to a separate mitmproxy instance, and the requests are going through the proxy, however they don't show up in seleniumwire. The requests do go through, as you can see in both the firefox GUI and through interactions with regular selenium methods.
Steps to Reproduce
and observe that driver.requests is empty.
other notes