Python Forum
Urls in a file to be executed
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Urls in a file to be executed
#1
I have a lot of urls in a file and all the urls in that file have to be executed in a browser one by one. Can anyone suggest the best method to solve this ?

Appreciate your help.
Reply
#2
you can use module webbrowser to open urls in default browser.
import webbrowser as wb def main(): urls = ["https://python-forum.io", "https://python-forum.io/Thread-Urls-in-a-file-to-be-executed"] for url in urls: wb.open(url) main()
Reply
#3
@luoheng - thank you very much. It worked charmingly. Appreciate your help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  total Noob question: Why is the code not executed MarkMan 5 1,291 May-09-2025, 06:15 PM
Last Post: deanhystad
  How to to extract urls across multple webpages at once? ilovewacha 2 1,562 Jun-18-2024, 06:04 PM
Last Post: snippsat
  How to not open the context menu if a mouse gesture is executed? MicheliBarcello 2 2,016 Aug-22-2023, 02:47 PM
Last Post: deanhystad
  return next item each time a function is executed User3000 19 7,675 Aug-06-2023, 02:29 PM
Last Post: deanhystad
  code not working when executed from flask app ThomasDC 1 5,131 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  I don't get the order of how things are executed with main() pythonrookie 5 4,616 Jul-21-2020, 01:35 PM
Last Post: pythonrookie
  Script works when executed from command prompt but not when executed in SDP Tippex 0 3,084 Apr-07-2020, 04:26 PM
Last Post: Tippex
  how to get PID's of linux commands executed through python modules? Manikandan_PS 4 5,214 Mar-12-2020, 07:16 AM
Last Post: Manikandan_PS
  Can a module be executed even if the computer running it does not install it? CFYB 5 5,625 Feb-08-2020, 01:56 PM
Last Post: snippsat
  Using Python to search through a list of urls jeremy 4 4,923 Dec-18-2019, 11:52 AM
Last Post: Malt

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.