方法 | 详情 |
---|---|
text_to_be_present_in_element() | 判断文本 |
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
driver =webdriver.Chrome()
driver.get("https://www.baidu.com")
#参数定位 id,对应值
locator =("id","su")
text =u'期望值'
result = EC.text_to_be_present_in_element_value(locator,text)(driver)
print(result)