Python LanguageWebbrowser Module

Introduction

According to Python's standard documentation, the webbrowser module provides a high-level interface to allow displaying Web-based documents to users. This topic explains and demonstrates proper usage of the webbrowser module.

Syntax

webbrowser.open(url, new=0, autoraise=False)

webbrowser.open_new(url)

webbrowser.open_new_tab(url)

webbrowser.get(usage=None)

webbrowser.register(name, constructor, instance=None)

Parameters

Parameter

Details

webbrowser.open()

url

the URL to open in the web browser

new

0 opens the URL in the existing tab, 1 opens in a new window, 2 opens in new tab