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
0 answers

Using .replace() to change date within link alters other words within link

I am using some code that takes advantage of webbrowser pkg to follow a link in Python and download data. Within the link the date is referred to multiple times in format DDMMMYY (ie. 24Jul19) - I am using the code to make sure the date refers to…
jod51
  • 111
  • 1
  • 2
  • 13
1
vote
2 answers

Python script unable to find locate downloads folder and open file

I am writing some automation code using python 2.7 and packages glob, webbrowser, and os to download links using google chrome. I have no issues downloading the file, but once downloaded, my script spits back that " 'C:/Users/UserName/Downloads*' is…
jod51
  • 111
  • 1
  • 2
  • 13
1
vote
4 answers

soup.select('.r a') in f'https://google.com/search?q={query}' brings back empty list in Python BeautifulSoup. **NOT A DUPLICATE**

The Situation: The "I'm Feeling Lucky!" project in the "Automate the boring stuff with Python" ebook no longer works with the code he provided. Specifically: linkElems = soup.select('.r a') What I have done: I've already tried using the solution…
Zack Plauché
  • 3,307
  • 4
  • 18
  • 34
1
vote
1 answer

Reaching internal chrome pages with Python webbrowser

I have a program where I'm using Python's webbrowser module to open a browser and navigate to a page automatically. My code essentially looks like the following: import webbrowser chrome_path = "C:/Program Files…
MLavrentyev
  • 1,827
  • 2
  • 24
  • 32
1
vote
1 answer

How to open web browser with an request object in python

I have a scenario in which I need to process some the web request automatically and finally show the result in the browser. The website I am querying uses partial response and ajax call to get the whole page. Is there a way in which I can open a…
Subhankar
  • 692
  • 7
  • 25
1
vote
0 answers

Webbrowser trying to open PDF file instead of html in browser

I'm trying to open a file in my browser with Python in a kivy app using the webbrowser module. Here is my code: import webbrowser import os from kivy.app import App from kivy.uix.button import Button class SimpleBrowserApp(App): def…
1
vote
1 answer

How can I make a simple web browser on python 3.6?

So far this is what I have and every place I've looked it says this code should work but it doesn't. import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('data.pr4e.org', 80)) mysock.send(b'GET…
ARR18
  • 11
  • 3
1
vote
0 answers

Py goto site using input

How would I go about getting Python to send a user to a website using input? I have this code so far, using the webbrowser import: import webbrowser if cmd == "it.in": topen=input("<> Enter a web adress. Be sure to add the htpp:// or htpps:// at…
mgmc2
  • 11
  • 4
1
vote
1 answer

Post data when opening a browser in Python

Is there a way to open a browser from a Python application, while posting data to it in POST method? I tried using webbrowser.open(url) to open the browser window, but I need to also post some data to it (via POST variables), to make sure the page…
Tom Shir
  • 462
  • 1
  • 3
  • 14
1
vote
1 answer

How does "webbrowser" module work?

Here is the code: Sublime plugin: File 1: open_in_default_program.py: # https://github.com/SublimeTextIssues/Core/issues/2368 import webbrowser import sublime_plugin class OpenInDefaultProgramCommand(sublime_plugin.TextCommand): def run(self,…
user90726
  • 939
  • 1
  • 8
  • 28
1
vote
1 answer

How to access html of after opening webpage with webbrowser

I was wondering if it possible to access the html or body of a webpage after opening one using the webbrowser library? import webbrowser url = "https://testwebsite.com/" chromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe…
Lux
  • 21
  • 2
1
vote
1 answer

Open listed URLs in order in Python 3?

I'm trying to open a set of URL links in a web browser in the order they are listed in, but every time I run the below code, the order is different. I'm new to scripting, but understand that lists keep order, which is what I am using below, so I'm…
KLL
  • 11
  • 1
1
vote
2 answers

Run function at a specific time in python

import time import webbrowser print(time.ctime()) targetTime = time.ctime() if(targetTime == "Tue May 01 11:05:17 2018"): webbrowser.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ") This is what I tried already and it doesn't open…
Bogdan
  • 47
  • 1
  • 1
  • 3
1
vote
0 answers

OSError: No such file or directory with python webbrowser

If I run the following: #!/usr/bin/python import webbrowser handle = webbrowser.get() handle.open('https://www.google.com') I have the following error # p-vim try.py Traceback (most recent call last): File "try.py", line 5, in
1
vote
1 answer

Suppress Firefox Terminal Messages Python/Linux

I'm new to Python programming and am attempting to make a script to open URLs/IP addresses with a web browser using Python's webbrowser module. The actual action of opening the web browser is working fine, but I am getting logging messages from…