I am trying to write a short scrip, which will help me open links from the list in separate browser tabs using Selenium/Python.
Here is the sample of my code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Opera()
driver.get(https://www.google.com/)
links = ['link_1', 'link_2', 'link_3']
for link in links:
# open a new tab
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + 't')
driver.get(link)
I using Opera 67. Somehow, the combination of keys Control + t doesn't work, pages are being opened one after another in the same tab. Any hint will be appreciated!