I know you start an internet browser with:
import webbrowser
webbrowser.open("http://www.google.com/")
But how do I specify if I wanted to for example, make it use firefox over the system default (internet explorer)?
I know you start an internet browser with:
import webbrowser
webbrowser.open("http://www.google.com/")
But how do I specify if I wanted to for example, make it use firefox over the system default (internet explorer)?
You can write
webbrowser.get('firefox').open("http://www.google.com/")
Sometimes it's better to open firefox with subprocess like this
import subprocess as sp
child = sp.Popen(['firefox', '-p', 'myprofile', '-no-remote', "http://www.google.com/"])
this allows you to open firefox with a different profile, or to close firefox later from your program (with child.terminate()).
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.