Teoman Yüksel Teoman Yüksel - 3 months ago 13
Python Question

Python 3 - webbrowser module - open() function

i write a piece of code in python, im a beginner and im learning modules.

import webbrowser as ac
ac.open("istihza.com")


it works correctly but when i run that, site is opening in internet explorer.
i want to make it opened with google chrome. Is any parameter to change browser? or i need something else?

Answer

Simply grab the appropriate controller instance and open the url with that:

import webbrowser as ac

chrome =ac.get('chrome')
chrome.open('istihza.com')
Comments