How to use the Python Webbrowser Module (Builtin)
gatorade322 (95)

A guide to Python’s Builtin webbrowser module


In Python, webbrowser is a module you can use to open websites. Webbrowser has 3 main functions. Open, open_new, and open_new_tab. They are basically the same. Supposedly, open_new will open a tab in a new window. I have tested that, and it does not work with Chrome, at least for my OS, ChromeOS. But, first let’s get into the code.


Webbrowser is builtin, so you do not have to install anything.

Importing Module

Since Webbrowser is builtin, you can just start by typing import webbrowser. Now we have webbrowser in. If you are in, you may have to install the dependencies, using the tab for that. I’m not sure, but I think, since it’s built in, you can just import webbrowser. I don’t know if supports it. It should, because you can easily open a new tab with html, css, JS, what is written in.

Opening a link

The first thing you will have to do, is type[linktext]). You can also do webbrowser.open_new([linktext]). Finally, you can do webbrowser.open_new_tab([linktext]). If you want, you can have the code take input for the link. Then the link imputed will be opened in a tab. Because, it might be confusing, here is an example of a link:

The full code

Finally, here is the* full code, (I’m assuming you want to get input for the link):

import webbrowser

webpage = input(‘Please enter the webbpage here: ’)‘https://’, webpage)
You are viewing a single comment. View All
gatorade322 (95)

@RhinoRunner, please state your error, your code, and why when I go to, it looks like a gaming website