0

How can I click on the following using Selenium in python?

<a onclick="ClearTrackingCode();" id="ctl00_phMainContent_CampaignGrid_grid_ctl02_btnSelect" title="Edit the selected campaigns" href="javascript:__doPostBack('ctl00$phMainContent$CampaignGrid$grid$ctl02$btnSelect','')">201362</a>

I have tried by ID + Name + Xpath

//*[@id="ctl00_phMainContent_CampaignGrid_grid_ctl02_btnSelect"]
4

1 回答 1

1
execute_script

解决了这个问题。

execute_script(script, *args) 在当前窗口/框架中同步执行 JavaScript。

Args :
script: 要执行的 JavaScript。*args:任何适用于您的 JavaScript 的参数。用法:driver.execute_script('document.title')

于 2013-07-05T22:48:24.223 回答