How to open a link embeded in a webelement with in the main tab, in a new tab of the same window using Control + Click of Selenium Webdriver

前端 未结 3 2033
一个人的身影
一个人的身影 2020-12-06 21:51

There is a link embedded in a web element in the Main Tab, I want to open that link in a new tab in the same window using Selenium Webdriver and python. Perform some tasks i

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-06 22:21

    Following import:

    selenium.webdriver.common.keys import Keys
    

    You have to send key:

    py_button.send_keys(Keys.CONTROL + 't')
    

提交回复
热议问题