Using webbrowser lib, I can start both Chrome and Firefox from a python script. It fails for Edge. I noticed ways to start Edge using webdriver but my question here is if it is possible to use the following script for edge. It currently starts Chrome only.
JavaScript
x
11
11
1
import webbrowser
2
3
chrome_path="C:Program Files (x86)GoogleChromeApplicationchrome.exe"
4
edge_path="C:WindowsSystemAppsMicrosoft.MicrosoftEdge_8wekyb3d8bbweMicrosoftEdge.exe"
5
6
webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chrome_path))
7
webbrowser.register('edge', None, webbrowser.BackgroundBrowser(edge_path))
8
9
webbrowser.get('chrome').open('http://www.google.com')
10
webbrowser.get('edge').open('http://www.microsoft.com')
11
Advertisement
Answer
Cant speak for your version of Windows, but in the latest, the edge filepath is
C:Program Files (x86)MicrosoftEdgeApplicationmsedge.exe