Python3.1 - Open Opera

I have no idea why this will not work ... I try to open the opera, but it says that it cannot find an executable browser.

op = webbrowser.get('C:\\Program Files\\Opera\\opera.exe')

op.open_new_tab('http://www.stackoverflow.com')
op.open_new_tab('http://www.stackoverflow.com')
+3
source share
3 answers

The name parameter should just be an opera:

op = webbrowser.get('opera')

Make sure that you have installed Opera on your computer and that the opera.exe executable is in the path.

>>> import webbrowser
>>> webbrowser.get ('opera')
<webbrowser.BackgroundBrowser object at 0x02095490>

See the table of valid values ​​for the name parameter in the documentation.

(, , , , ), :

op = webbrowser.get(r'C:\\Program Files\\Opera\\opera.exe %s')
+2
0

Source: https://habr.com/ru/post/1778601/


All Articles