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
1
vote
2 answers

Very basic alarm clock does not open webbrowser

I'm totally new to programming. Wanted to write this basic alarm clock with Python but the webbrowser just doesn't open. I think it is probably my if statement that doesn't work. Is that correct? from datetime import datetime import…
p6l-richard
  • 321
  • 2
  • 11
1
vote
1 answer

How to capture HTTP errors from python's webbrowser

I wrote a small python script to programatically open url's in chrome every six seconds. #!/usr/bin/env python import webbrowser import time f = open("data.txt", "r") urls = f.readlines() safari = webbrowser.get('open -a /Applications/Google\…
Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158
1
vote
0 answers

Is there any way to know if a python webbrowser page has been responded to?

I'm using python to display a web page with webbrowser like this: url = "file://c/python27/debug.html" webbrowser.open_new_tab(url) The user then enters some values on the page and clicks submit. At that point I need my python script to do another…
Kevin K
  • 11
  • 4
1
vote
0 answers

displaying temporary files in webrowser using python

I want to create a file, display it in a web browser, then delete the file as soon as it is loaded in the browser. This is my attempt (I use this for SVG files, but I made it use a txt file for a simple example). For me, the file is deleted before…
mathandy
  • 1,892
  • 25
  • 32
1
vote
0 answers

Open a download Link , rename file and close webbrowser in Python

First off, sorry for the lack of code; verbiage is the only thing that I can think of using to describe the problem I have a link which when I run it using: webbrowser.open('http://www.MyLink&ticker=IBM') automatically downloads IBM data for me. …
John
  • 531
  • 1
  • 8
  • 23
1
vote
0 answers

Python Kiosk mode from webbrowser module

I am trying to achieve the following: Have a browser load when my python script starts, and sit idle in the background until it is needed, then pass the URL to the browser and bring it to the front, in full screen kiosk mode. The reason I want to…
Aphire
  • 1,621
  • 25
  • 55
1
vote
1 answer

Python: webbrowser.open("") opens a file explorer window

I'm coding a very simple url opener that gets the url in the terminal window (using input) and opens it with webbrowser.open. The problem is that when nothing is put into the input (it's run webbrowser.open("")), a file explorer window appears…
dccsillag
  • 919
  • 4
  • 14
  • 25
1
vote
0 answers

how to delete a tempfile later

On python 2.7, I am currently using the following code to send data via a post request to a webpage (unfortunately, I cannot really change this). I prepare a string data which I prepare according to…
1
vote
1 answer

python webbrowser leaves the shell open

I made a small python programm with the webbrowser modle wich is supposed to open a new tab in the browser and go to http://kivy.org/#home. I ran it with the linux shell and it worked fine, a new tab was opened and it went to…
Gilgamesch
  • 313
  • 2
  • 10
  • 24
1
vote
1 answer

Java equivalent to Python's webbrowser.open()

I just finished a project with Python and now I am trying to convert it into Java. I have a lot of things done but I am stuck on this one part. In python, I am opening a random link from a list on the web browser with this code import…
michaelpri
  • 3,521
  • 4
  • 30
  • 46
1
vote
1 answer

Why is webbrowser lib acting differently when run locally vs. remotely?

I'm writing a Flask (python 2.7) application in which a function uses the webbrowser lib to open several new tabs in the user's browser (similar to Kayak). The app works correctly when I run it locally. But when I deploy to OpenShift, the app…
nealrs
  • 435
  • 1
  • 5
  • 19
1
vote
0 answers

python-mailto create email and show URL as linked text

I currently have import webbrowser subject = urllib.quote('Some subject') body = urllib.quote('here is a link: https://www.google.com') cmd = u'mailto:?subject={}&body={}'.format(subject, body) webbrowser.open(cmd) This will create an email where…
mingxiao
  • 1,712
  • 4
  • 21
  • 33
1
vote
1 answer

Running a portion of code as NON-root?

My program runs with root privileges, but I need a portion to run as an unprivileged user. Basically, webbrowser.open(SITE) doesn't work as root. My code needs to run as root other than this. I've tried the following: subprocess.call("sudo -u " +…
Cody Dostal
  • 311
  • 1
  • 3
  • 13
1
vote
1 answer

Open a specific page on a website

Using the webbrowser module, I want to open a specific page on last.fm. It picks a line from a text file then prints it. I want it to add that line at the end of: webbrowser.open('http://www.last.fm/music/') So for example, the random.choice picks…
Brian Fuller
  • 386
  • 1
  • 3
  • 12
1
vote
2 answers

Simple Python Webbrowser Loop

I am trying to have this program open a tab, wait for 15 seconds, then quit Chrome and reopen the tab immediately. Right now, it opens a tab, waits for 15 seconds then closes Chrome and waits for another 15 seconds before reopening it. How would I…
Nick
  • 13
  • 1
  • 4