Questions tagged [python-webbrowser]

Python module that allows the user to load web content with available browsers.

The webbrowser module provides a high-level interface to allow displaying web-based documents to users. Under most circumstances, simply calling the open() function from this module will do the right thing.

More info: https://docs.python.org/3/library/webbrowser.html

406 questions
41
votes
14 answers

python's webbrowser launches IE, instead of default browser, on Windows relative path

I'm attempting to launch a local html file from python in the default browser (right now my default is Google Chrome if I double-click on a .html file, Chrome launches.) When I use python's webbrowser.open(), IE launches instead, with a blank…
McLeopold
  • 5,967
  • 5
  • 21
  • 14
24
votes
3 answers

Force Jupyter Notebook *not* to open a web browser

I'm running Jupyter notebooks (Python 3) on a remote cluster that I'm connected/tunneled to over SSH. Jupyter's default behavior is to try to open the dashboard in a web browser when it launches -- aparently (I only just updated), at some point they…
Linuxios
  • 34,849
  • 13
  • 91
  • 116
22
votes
4 answers

How to close the existing browser tab using the Python webbrowser package

Using Python webbrowser package I can open a new tab with a specified URL. Is there a way to close this tab? I referred the below official docs and nothing related to close action is mentioned. Python webbrowser package doc:…
kane.zorfy
  • 1,000
  • 4
  • 14
  • 27
13
votes
1 answer

Python WebBrowser Open In Same Tab

running this line: webbrowser.open(page.path, new=0, autoraise=True) I always get the page opened in a new Tab. How can I get it in the same Tab as it should be using new=0?
user3755529
  • 1,050
  • 1
  • 10
  • 30
12
votes
2 answers

How to close web browser using python

I have opened a webbrowser window using webbrowser.open(url) in python now I want to close the webbrowser opened using python. Is it possible to do so?
Pissu Pusa
  • 1,218
  • 3
  • 16
  • 26
12
votes
5 answers

Can I use python to create flash like browser games?

is it possible to use python to create flash like browser games? (Actually I want to use it for an economic simulation, but it amounts to the same as a browser game) Davoud
Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82
9
votes
3 answers

Python: Request URL via POST and show result in browser

I'm a developer for a big GUI app and we have a web site for bug tracking. Anybody can submit a new bug to the bug tracking site. We can detect certain failures from our desktop app (i.e. an unhandled exception) and in such cases we would like to…
Sergio
  • 4,537
  • 4
  • 33
  • 41
9
votes
1 answer

how to get webbrowser module for python 3.6 using pip ?

C:\Users\vipul>pip install webbrowser Collecting webbrowser Could not find a version that satisfies the requirement webbrowser (from versions: ) No matching distribution found for webbrowser whenever I try to install I get this error
Vipul Rodrigues
  • 127
  • 1
  • 1
  • 7
9
votes
5 answers

how to open chrome in incognito mode from Python

This works, in powershell: Start-Process chrome.exe -ArgumentList @( '-incognito', 'www.foo.com' ) How can this be achieved from Python?
3z33etm
  • 1,083
  • 3
  • 15
  • 23
8
votes
3 answers

Add web browser window to Tkinter window

I made a gui app with python tkinter, I want to put a little mini little web browser inside my tKinter windown, without opening a new tab. How can I do that?
8
votes
2 answers

Advanced mailto use in Python

I'm trying to send an email with custom recipient, subject and body in Python. This means I don't want to use Python's smtp packages, but something like webbrowser because I need this to open the default email client (Thunderbird in my case) with…
Fabio Mancin
  • 133
  • 3
  • 10
8
votes
2 answers

Return data from html/js to python

I have an html form which is populated by javascript functions. I have another javascript function which gets the values of all of the form elements, and currently just uses an alert to display them back to the user. The html page is diplayed via…
BloonsTowerDefence
  • 1,184
  • 2
  • 18
  • 43
7
votes
2 answers

Error "tcgetpgrp failed: Not a tty" using python3 to open web browser

Here's the breakdown of my Windows WSL environment: Windows 11 WSL version 2 Ubuntu version 20.04.3 LTS Python 3.8.10 I have a super simple Python program I'm using to open a web page in my default browser. Here is my code: import…
Gharbad The Weak
  • 1,541
  • 1
  • 17
  • 39
6
votes
2 answers

Python refresh HTML document

I have an HTML document that I am able to open with the webbrowser module by specifying it as the URL that I want to open, this works fine. I want this document to be able to refresh itself (in a way other than reopening itself) with a Python script…
Dan Doe
  • 1,146
  • 3
  • 14
  • 25
6
votes
3 answers

Is it possible to use `externalbrowser` authenticator inside docker container for connection authentication with Snowflake?

I am trying to use the snowflake connector inside docker container. I want to use the externalbrowser authenticator so that I can make connection using Okta credentials but the connector is failing with below mentioned error. DatabaseError:…
1
2 3
27 28