Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #write #code #python #Open #links #page #separate #browser #tabs
ADD COMMENT
Topic
Name
4+9 =