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
Use the
webbrowsermodule.If you don’t want to enforce a particular browser and just start the default one, use
webbrowser.open_new_tab.The
webbrowsermodule isn’t very reliable, especially on Windows, so you might have to start the process manually using thesubprocessmodule:Also, Firefox supports multiple URLs in the command line, so the following solution is better for it: