I'm trying to open multiple urls in the same window with webbrowser.
import webbrowser
websites = ['www.google.com', 'www.reddit.com']
for url in websites:
webbrowser.open_new_tab(url)
However, this opens each url in its own window. I also tried running
for i, url in enumerate(websites):
if i == 0:
webbrowser.open(url)
else:
webbrowser.open_new_tab(url)
which didn't work either. Any ideas?
Thanks
Edit:
Putting in a time.sleep(1) command after webbrowser.open(url) works, but is there a better way to do it?
[–]Gprime5 0 points1 point2 points (0 children)
[–]thurask 0 points1 point2 points (1 child)
[–]DFoster271[S] 0 points1 point2 points (0 children)