wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.86k stars 240 forks source link

driver.requests is empty list with MSEdgedriver #725

Open TAPringle opened 7 months ago

TAPringle commented 7 months ago

Hi,

Using MSEdgedriver 119.0.2151.58, driver.requests returns only an empty list after using the click() or get() methods to access a url. I am presently using selenium 4.15.2 and selenium-wire 5.1.0. This functionality works as expected when using chromedriver, while executing the same code (without the Edge-specific things like the port selenium-wire options).

Upon inspecting the objects and looking at the capabilities dict, I noticed a few differences which were unable to be resolved through setting options in EdgeOptions.

# Edge Capabilities where different than Chrome
{
'proxy': {}
}
# Chrome capabilities where different than Edge
{'proxy': {'httpProxy': '<something here>',
'proxyType': 'manual',
'sslProxy': '<something else here>'}}

I have omitted things which are bound to be unique to chrome or edge, but the automatic filling of the 'proxy' item in chrome and not edge feels like to could be the issue? For additional context, both these browsers are managed by an organizational VPN, but chrome still makes its own proxy without issue.

Update It turns out nothing was being returned between uses of the same socket between runs of the script. Rotating the socket to another allowed driver.requests to correctly collect a list of returned requests.