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
  How to not open the context menu if a mouse gesture is executed? MicheliBarcello 2 661 Aug-22-2023, 02:47 PM
Last Post: deanhystad
  return next item each time a function is executed User3000 19 2,275 Aug-06-2023, 02:29 PM
Last Post: deanhystad
  code not working when executed from flask app ThomasDC 1 872 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  I don't get the order of how things are executed with main() pythonrookie 5 2,556 Jul-21-2020, 01:35 PM
Last Post: pythonrookie
  Script works when executed from command prompt but not when executed in SDP Tippex 0 1,996 Apr-07-2020, 04:26 PM
Last Post: Tippex
  how to get PID's of linux commands executed through python modules? Manikandan_PS 4 3,041 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 3,400 Feb-08-2020, 01:56 PM
Last Post: snippsat
  Using Python to search through a list of urls jeremy 4 2,850 Dec-18-2019, 11:52 AM
Last Post: Malt
  C API: Writing Executed Code to a File myanrueller 0 1,696 Nov-17-2019, 09:35 PM
Last Post: myanrueller
  user validation for opening urls Ashley 6 2,706 Jul-08-2019, 09:08 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020