Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:56:42+00:00 2026-06-12T05:56:42+00:00

i am trying to lunch multiple urls from a text file in Firefox via

  • 0

i am trying to lunch multiple urls from a text file in Firefox via python. i am using win7 OS & python 3. i need some direction to pass the argument to Firefox.

import os
import subprocess

f = open ('C:\\Users\\test\\Desktop\\urls.txt','r')
data = f.read()
print(data)
# i need some help here to pass this argument to Firefox.
f.close()

urls.txt

http://www.abc.com
http://www.xyz.com/test
http://www.abc.net/test.html
http://www.test.com
http://www.msn.com
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:56:46+00:00Added an answer on June 12, 2026 at 5:56 am

    Use the webbrowser module.

    import webbrowser
    firefox = webbrowser.get('firefox')
    for url in data.split('\n'):
        firefox.open_new_tab(url)
    

    If you don’t want to enforce a particular browser and just start the default one, use webbrowser.open_new_tab.

    The webbrowser module isn’t very reliable, especially on Windows, so you might have to start the process manually using the subprocess module:

    import subprocess
    firefox_path = 'C:/Program Files/Firefox/firefox' # change this line accordingly
    for url in data.split('\n'):
        subprocess.Popen([firefox_path, url])
    

    Also, Firefox supports multiple URLs in the command line, so the following solution is better for it:

    import subprocess
    urls = open('C:/Users/test/Desktop/urls.txt').read().split('\n')
    subprocess.Popen(['C:/Program Files/Firefox/firefox']+urls)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to load xls file with Jexcel API from http://udios.site88.net/Lunch.xls with this code:
I'm trying to launch a website url in a new tab using python in
From the get go, let me say that I'm trying to avoid using pcntl_fork()
I'm trying to lunch ntbackup on shutdown but the backup file (.bkf) is only
I'm using VB.Net to launch multiple command line window (same exe file) through Process.StartInfo.
I'm trying to run multiple test cases for a login Activity using ActivityInstrumentationTestCase2. The
I am trying to lunch one-jar using web start and I am getting error
I'm trying to use python to launch a command in multiple seperate instances of
I'm trying to bash together a (very) rough MP3 player during my lunch hour,
I'm trying to launch an activity from a custom lisview. I have hoded the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.