python+splinter如何定位动态ID的按钮
<button id="vbase_login_loginVBASE_JGButton1_8a819ea061eacc110161f4c00f666f0a" widgetcode="JGButton1" type="button" class="btn btn-primary btn-lg btn-block " style="text-align:Center">登录</button>如上标签,ID的值后面是动态生成的,每次都不一样
试了方法一:
btn=bs.find_by_text('登录')
btn.click
btn.click
按上面的写法,不会点击,print(btn),如下:
[<splinter.driver.webdriver.WebDriverElement object at 0x000000000E941FD0>, <splinter.driver.webdriver.WebDriverElement object at 0x000000000E941EF0>]
试了方法二:
bs.find_by_xpath("//*").click
报这个错:
no elements could be found with xpath "//*"
请问大神,还有什么办法?
页:
[1]