Skip to content

Instantly share code, notes, and snippets.

@sc0rp10n-py
Forked from hakluke/openinbrowser.py
Created January 2, 2021 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sc0rp10n-py/6f91fefe6db44488528a2091d0254655 to your computer and use it in GitHub Desktop.
Save sc0rp10n-py/6f91fefe6db44488528a2091d0254655 to your computer and use it in GitHub Desktop.
Little Python script to open a list of URLs from a file in browser tabs, n tabs at a time
#! /usr/bin/python3
import webbrowser, sys
if len(sys.argv) < 3:
print("Usage: openinbrowser.py ./urls.txt 20")
quit()
f = open(sys.argv[1])
tabs = int(sys.argv[2])
counter = 1
for url in f:
counter += 1
webbrowser.open_new_tab(url)
if counter == tabs:
input("Press any key to continue...")
counter = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment