1#import from selenium driver
2from selenium import webdriver
3#import from use of Key actions && Action chains (commands) from selenium driver
4from selenium.webdriver.common.keys import Keys
5from selenium.webdriver.common.action_chains import ActionChains
6from selenium.webdriver.common.by import By
7import time
8
9
10#designate each URL to be opened
11url_1 = 'https://www.google.com/'
12url_2 = 'https://github.com/'
13url_3 = 'https://www.kaggle.com/'
14
15#designate webdriver as chrome
16driver = webdriver.Chrome()
17
18#open 1st URL in first tab
19driver.get(url_1)
20
21#wait
22driver.implicitly_wait(15)
23
24#open new window (tab 2) and switch over to it
25driver.execute_script("window.open('');")
26driver.switch_to.window(driver.window_handles[1])
27
28#open 2nd URL in current tab
29driver.get(url_2)
30
31#wait
32driver.implicitly_wait(15)
33
34#open new window (tab 3) and switch over to it
35driver.execute_script("window.open('');")
36driver.switch_to.window(driver.window_handles[2])
37
38#open 3rd URL in current tab
39driver.get(url_3)
40
41#wait
42driver.implicitly_wait(15)
43