This is what I have so far. Do I need to change anything to make webbrowser package use Google Chrome?
import webbrowser
web = input('What website would you like to open? i.e. pbskids.org')
webbrowser.open(web)
This is what I have so far. Do I need to change anything to make webbrowser package use Google Chrome?
import webbrowser
web = input('What website would you like to open? i.e. pbskids.org')
webbrowser.open(web)
Follow these steps in your Python Application to open URL in Chrome Browser.
Register the browser type name using webbrowser. register()
. Also provide the browser executable file path.
Get the controller object for the browser using webbrowser. get()
and Open URL using open()
. More details Here
Here is an example;
import webbrowser
url = 'https://pythonexamples.org'
webbrowser.register('chrome',
None,
webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe"))
webbrowser.get('chrome').open(url)
Try setting the default browser as IE and then change it back to Chrome again?
Check the preferences of your programming app (Eg. PyCharm, Jupyter etc.)