[英]click button in python selenium
first off that button does not have an id='button'
首先那个按钮没有
id='button'
without seeing the website you could try do something like:在没有看到网站的情况下,您可以尝试执行以下操作:
login_button = driver.find_element(By.TAG_NAME, 'button')
login_button.click() # this assumes that there are no other buttons on the page as find_element finds the first button on the page
OR要么
login_button = driver.find_element(By.CLASS_NAME, 'btn')
login_button.click() # this assumes that there are no other elements with the `btn` class to click
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.