Skip to content
Advertisement

How can I open a website in my web browser using Python?

I want to open a website in my local computer’s web browser (Chrome or Internet Explorer) using Python.

open("http://google.co.kr") # something like this  

Is there a module that can do this for me?

Advertisement

Answer

The webbrowser module looks promising: https://www.youtube.com/watch?v=jU3P7qz3ZrM

import webbrowser
webbrowser.open('http://google.co.kr', new=2)
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement