I have to try to click an element on a web page, and I want the link after the click should open in a new tab, here is the code snippet:
browser.find_element_by_xpath('//*[@id="container"]/main/div/sec[1]').click()
# Above code open the link but in the same tab.
I have tried the following code to open it in a new tab:
browser.find_element_by_xpath('//*[@id="container"]/main/div/sec[1]').send_keys(Keys.CONTROL + 't').click()
# But it's not working.
How to open this in a new tab?
P.S.: This is not the link to open in a new tab, its the element to be opened on a new tab, so don't mark it as duplicate.