对于以下检查,我无法单击“MARK WebAttention”按钮
<div class="box1child" ng-show="markAttendance"><button ng-show="showMarkAttendance" style="background-color:#398439;">MARK ATTENDANCE</button></div>
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Ie()
driver.get("https:*********/WebAttendance/index.html")
mark_webattendance = driver.find_element_by_xpath("//button[@ng-show='showMarkAttendance']")
mark_webattendance.click()
访问按钮的方式-
或
或
马克•韦伯=driver.find\元素\u by\ xpath(“//按钮[包含(text(),'标记考勤')]”) driver.implicit\u等待(10000) 标记_webattention.click网站()
xpath的用法是
//tagName[@attribute = 'value']
这是为了精确匹配//tagName[contains(text(), 'value')]
这是用于包含值的字符串 另一个选项是//tagName[contains(@attribute, 'value')]
相关问题 更多 >
编程相关推荐