Skip to main content

Open a web page with Python

Open a web page with Python


To do this we will use the webbrowser module. This code will open any link with Chrome. You will have to change the path to your browser installation.
    import webbrowser


    chrome = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
    link = "www.google.com"

    webbrowser.get(chrome).open(link)

Comments