我正在努力寻找一种方法来单击以下课程中的“提交”按钮。它不包含ID,名称或任何不是动态生成的易于识别的方法。任何帮助表示赞赏。
到目前为止,我已经尝试过:
driver.find_element_by_xpath("//div[@class='button-status-container'][@type='submit']")
driver.find_element_by_xpath("//div[@class='button-status-container']//button-status-container[@type='submit']")
driver.find_element_by_css_selector('.button-status-container[type="button"]')
以上所有错误均由排除NoSuchElementException
。提交按钮的htlm
我认为正确的xpath / css选择器应为:
driver.find_element_by_xpath("//div[@class='button-status-container']/button[@type='submit']")
driver.find_element_by_css_selector('.button-status-container > [type="button"]')
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句