Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

write code in python to Open all links on a page in separate browser tabs

import webbrowser
url = 'http://www.stackoverflow.com'
url2 = 'http://www.stackexchange.com'

def main():
    webbrowser.open(url2) # To open new window
    print('Opening Stack Exchange website!')
    webbrowser.open_new_tab(url) # To open in new tab
    print('Opening Stack Overflow website in a new tab!')

if __name__ == '__main__':
    main()
Comment

PREVIOUS NEXT
Code Example
Python :: unable to import flask pylint 
Python :: pyqt5 spin box change value trigger 
Python :: Python Permutation without built-in function [itertools] for String 
Python :: using polymorphism in python 
Python :: python meanGroups(a): 
Python :: python yield from 
Python :: run python script task scheduler 
Python :: what is cpython 
Python :: django migrate 
Python :: stripping whitespace in python 
Python :: how to python string up 
Python :: find email address pytho 
Python :: Binary search tree deleting in python 
Python :: Python Permutation without built-in function [itertools] for Lists 
Python :: flask get request port 
Python :: python 3.7 download 
Python :: string to list 
Python :: multithreaded programming in python 
Python :: rgb to grayscale python 
Python :: how can I print all items in a tuple, separated by commas? 
Python :: Power Crisis 
Python :: list vs dictionary python 
Python :: Python use number twice without variable 
Python :: where are docker logs 
Python :: split string with first numerical value in python 
Python :: convert decimal to float in python 
Python :: python selenium teardown class 
Python :: pyhton comment 
Python :: python dict to string 
Python :: install tabula 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =