I'm learning Python and I'm trying to create my own script to automate stuff at work. I'm trying to open a web browser (no matter which one) with a default url and 2 or more tabs with different urls. I tried open_new(), open(), open_new_tab() but it doesn't work. It opens a browser (first url) and when I close its window then opens the second url in a new window.
def open_chrome():
url = 'www.amazon.com'
url2 = 'www.google.com'
browser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
webbrowser.get(browser).open_new(url)
time.sleep(2)
webbrowser.get(browser).open_new_tab(url2)
open_chrome()