如何使用selenium python单击此按钮

时间:2018-04-23 16:43:51

标签: python selenium

<button id="upload-resume" type="button" class="btn btn-primary btn-lg btn-block ng-binding" ng-show="canUpload()" ng-click="submit()" ng-disabled="submitButtonDisabled" tabindex="0" aria-hidden="false" aria-disabled="false">Continue</button>

如何使用selenium python点击此按钮

1 个答案:

答案 0 :(得分:1)

试试这段代码:

upload_button = driver.find_element_by_id("upload-resume")
upload_button.click()  

如果您想使用Xpath,那么您可以使用以下代码:

 upload_button = driver.find_element_by_xpath("//input[text()='Continue']")  
 upload_button.click()