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
2
votes
3 answers

Can python be used to log onto password protected sites for checking gmail, forums, etc...?

I know you can open webpages quite simply using the webbrowser module like: import webbrowser webbrowser.open('http://www.google.com') but is it possible to pass log-in credentials to these websites? I would like to create a script that automates…
NSchrading
  • 144
  • 1
  • 13
2
votes
1 answer

No application is registered as handling this file in bundled Python program

I am using Ubuntu 21.04 with Python 3.8, Matplotlitb 3.4.3, pyinstaller 4.5.1 and I would like python program to open google.com page in default web browser. There is also matplotlib package (the reason why it's not working, without matplotlib…
Michal
  • 1,755
  • 3
  • 21
  • 53
2
votes
1 answer

Why do I get "webbrowser.Error: could not locate runnable browser"?

I'm new to coding in python and I'm wondering if some one can explain why this code works on the second try but not on the first? I was just trying to open a browser that was not the default one. first try --> did not work import…
bori
  • 35
  • 4
2
votes
1 answer

How can I use Python's webbrowser.get within a docker container

So I have been trying to use webbrowser.get from within my Docker container but it is failing to find a browser to launch. I believe there are two ways to do this: mount the location of my current browser within my container and point the…
2
votes
1 answer

Webbrowser.Open open two tabs

My code below open two times browser tab, why? from flask import Flask from flask import render_template import webbrowser app = Flask(__name__) @app.route("/charts") def chart(): legend = 'Monthly Data' labels = ["January", "February",…
2
votes
2 answers

Opening Webbrowser after Running A Server with Bottle

I am trying to create a program that will start a server with the Bottle module and then open the server url with the webbrowser module. I am having issues opening the webbrowser AFTER starting the bottle server. If i open webbrowser before starting…
2
votes
2 answers

Installing and running browser in colab for selenium

I know google colab can be used for selenium module, but before using selenium, there should be a browser in colab virtual machine, so I have successfully installed firefox in colab by using the commands !apt-get update !apt install firefox but…
2
votes
2 answers

How to click a web browser button using python?

I am new to Python and currently I am working on a program to capture full page screen and email it to specific persons. I have done the email part well. But I am finding difficulty to find a python script that clicks on "Full Page Screen Capture"…
2
votes
0 answers

How to navigate to a section tag # when opening a URL with Python's webbrowser?

When using Python's webbrowser.open(local_webpage_url#section) the #section tag at the end of the local_webpage_url gets ignored and the browser opens the HTML page but does not navigate to the section. (The address bar also does not show the…
Barus
  • 101
  • 14
2
votes
1 answer

Change default browser while using scrapy's shell view function

While on a scrapy shell, when I try to use the view(response) function, instead of opening a browser, it opens Visual Studio Code. How to make it open on a browser? I read that webbrowser is the library used to view the page and that I could set the…
FTM
  • 1,887
  • 17
  • 34
2
votes
3 answers

list for a Python web application malfunctioning

I need some help with a code that I am working on for my coursera class, the objective is as follow: Find the link at position 18 (the first name is 1). Follow that link. Repeat this process 7 times. The answer is the last name that you…
py va
  • 31
  • 4
2
votes
2 answers

How to make python close a website

So, with python i've seen that you can open a website using the code import webbrowser webbrowser.open("http://www.example.com", new=2) but i really want to know how you could close the same specific tab using python. If you can help please do.…
Coder Cody
  • 95
  • 1
  • 10
2
votes
1 answer

How to open new tab in browser using python and send POST data?

I am using Python's webbrowser module and I think it only supports opening a new tab in my browser. I like to send data using POST request using python and open that in my browser. Is there any library for that?
2
votes
0 answers

Code which checks file size of video using download link before downloading? [edited]

I was reading the book 'Automating the boring stuff with python' where I read about webbrowser module. I tried to make a program that downloads a given number of videos from the web. But since Chrome starts multiple downloads simultaneously, I…
2
votes
1 answer

webbrowser open location python

I'm trying to open a specific location within an HTML file with python, but it doesn't work. The code is import webbrowser url = '~\docs\index.html#api.method_name' webbrowser.open(f'file:///{url}') This code opens the file in the browser, but the…
llulai
  • 627
  • 1
  • 6
  • 9