How to open the URL in browsers using Python?

The easy way to develop the application in python is that we can easily import the libraries. Among those, webbrowser module provides a high-level interface to allow displaying Web-based documents to users.

1. Download and install webbrowser library

$ pip install webbrowser

2. Open a page in the browser

import webbrowser'')

3. Open a page with new tab in the browser

import webbrowser

4. Open a page in the specific browser

import webbrowser
chrome= "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"

That’s it. I hope this will help. ?

Leave a Reply

Your email address will not be published. Required fields are marked *