Let's say there is an element with xpath "//a[@href]" that doesn't have a direct link to it and when clicked opens the UNKNOWN url in the current tab. Is there a way to make it open the URL in another tab instead of current one, so basically to "divert" the click into an another tab.
Here is some clarification:
driver.execute_script("arguments[0].click();", element) # clicks on an element
driver.execute_script("window.open()")
First line will click an element, and second would open a new tab, but as it is these lines aren't connected. Is there a way to execute just one script that would perform the click AND redirect it to be opened in a new tab?