wkeeling / selenium-wire

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

Add documentation how to use it with Edge #199

Closed T3rm1 closed 2 years ago

T3rm1 commented 3 years ago

When using this with Edge you will get the error message _You must set a port number in the seleniumwireoptions This needs better explanation. What should be done? Do we need to configure Edge? Which settings? Proxy settings? Which port should we set? Which hostname should we set?

I tried setting the Edge proxy to localhost:13371 and seleniumwire_options={'port': 13371} but that didn't work. -> Max retries exceeded

I tried to search for this issue but it seems no one uses this with Edge so there is no solution on the web yet.

wkeeling commented 3 years ago

Thanks for raising this. Selenium Wire did have setup instructions for Edge before version 3, but these were removed (as were the instructions for Safari) as they seemed to cause more problems than they were worth.

The configuration for Edge and Safari is more complicated than for Firefox and Chrome, because neither Edge/Safari support auto proxy configuration nor the ability to ignore untrusted certificates via the webdriver interface. This means that a number of manual steps have to be carried out and these steps tended to trip people up. Plus I also no longer have the ability to test Safari. So I took the decision to remove the instructions completely - effectively removing support for these browsers - although I did leave the webdriver classes as you've discovered. I suppose I should either remove those classes, or reinstate the instructions and improve them.

It sounds as though you were half way to getting Edge working if you set up the Edge proxy and passed the port number to Selenium Wire. The "max retries exceeded" may have happened because you hadn't completed the certificate step. It may be worth installing the ca.crt as a trusted certificate authority (mentioned in those Edge instructions linked above) and then see whether that gets you past the error.

nrllh commented 2 years ago

Hi @wkeeling It's also for me interesting to know how to use another popular browsers such as Brave, Edge, and Opera with selenium-wire. Are the instructions the same for all Chromium-based browsers?

wkeeling commented 2 years ago

@nrllh We don't have driver implementations for Edge or Opera currently, although you can try using the ChromeDriver and point it at Edge/Opera since they all derive from ChromiumDriver. There isn't an implementation of Brave in Selenium yet so I don't think you'll be able to use that.

wkeeling commented 2 years ago

Support for Microsoft Edge is now available in Selenium Wire 5.0.0