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
1 answer

i want to open new Link in the same tab in Webbrowser Python

I want to create a script that open links automatically. But i want the program to open the link in a one page pop up.. i tried to open two links one by one in the same tab, but it always open it in a new Tab in the same Browser. this is the…
axchraf
  • 11
  • 2
1
vote
1 answer

I am working with automating whatsapp with Webbrowser library but I am getting a problem

I am using the Webbrowser library in python to sent messages on WhatsApp. But the problem is that I have to click on send message manually by going to whatsapp and clicking send. This is my code: import webbrowser num = ('72********') message =…
Harsimrat
  • 11
  • 3
1
vote
1 answer

Python webbrowser.open() is not working in VScode (already try two environment )

I'm trying to use the python webbrowser.open() to open a webpage, the code run perfectly, did not has any error in the terminal, but no webpage has pop out. import webbrowser urlstr='https://www.twse.com.tw' path=r"C:\Program Files…
J. L
  • 11
  • 1
1
vote
0 answers

How do you open a page over your current tab?

Reason I previously asked the same question but using a different language (small basic), yet received little help. For this reason, I re-scripted the program in python hoping to reach a wider audience, despite the fact I am a beginner with…
1
vote
1 answer

Python Webbrowser module not giving the desired output

Hey guys I'am testing a python module named 'webbrowser' but its not giving any responses when I tries to open youtube. Please solve this problem. This is the code. import webbrowser webbrowser.open("www.youtube.com") And I'm not getting any error…
1
vote
1 answer

Python: xpath extraction not working in loop

I have a python list containing these five…
1
vote
1 answer

How to open url in browser with custom headers using python

I have tried using the webbrowser module, with the code below but want to set custom headers such as: 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304…
Hammaad
  • 193
  • 1
  • 2
  • 14
1
vote
0 answers

Open URL in Python in existing TAB?

I tried to use webbrowser to open a chrome tab.I tried it's every settings but it always opened url in new tab. Is there any solution to open URL in same Tab?
C.Ergin
  • 21
  • 4
1
vote
1 answer

Python Selenium click load more on table

I am trying to get the whole data of this table. However, in the last row there is "Load More" table row that I do not know how to load. So far I have tried different approaches that did not work, I tried to click on the row itself by this: from…
1
vote
1 answer

How to get a URL from python 'webbrowser'?

I'm using 'webbrowser' for opening multiple tabs in Chrome/Firefox. For example: webbrowser.get("open -a /Applications/Firefox.app %s").open('http://google.com',new=1) But the problem is, in somecases, the url gets changed(may be redirected to…
1
vote
1 answer

Download file from a URL in Azure Pipelines Microsoft hosted agent

I'm running a Python script task in Azure YAML pipeline. A JSON file gets downloaded when the URL is accessed via a browser. URL - https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519 What I've done so far --> - task: PythonScript@0 …
1
vote
0 answers

How to tell when python webbrowser has finished playing video

So I using code like this to open a YouTube link with webbrowser in python: webbrowser.open("youtube.com/watch?v=" + videoLink) and I need to tell when the video finishes so I can then do: os.system("TASKKILL /F /IM chrome.exe") Does anyone know…
1
vote
2 answers

Trouble selecting google one box tab in selenium

going to https://www.google.com/search?q=tennis a google one box comes up for scores, I'm trying to click on the tabs and (Women's Singles, Men's Doubles etc) and having no luck. I've tried all methods, xpath, classname, partial link text, css…
1
vote
3 answers

Logging into Gmail using Python with detecting failed login

I know that multiple people have asked a similar question about this however, I would like to know how to login to gmail (or google account) using python. I have a code already (see below) that can loggin the user to gmail using selenium. However I…
1
vote
0 answers

Python-Webbrowser module doesn't work on terminal

My code is here: import webbrowser import time print("Directing to youtube") webbrowser.open("http://www.youtube.com", new=1) time.sleep(3) This runs in pycharm's terminal perfectly but it doesn't work in mac's own terminal. I installed a third…
YetkinG.
  • 51
  • 1
  • 4