【发布时间】:2020-03-10 08:59:03
【问题描述】:
【问题讨论】:
-
You are missig the close ')' --> //div[contains(text(),"Review") and contains(text(),"received")]
标签: python frameworks robot
【问题讨论】:
标签: python frameworks robot
文本属于两个不同的标签。您可以查找带有"Review" 文本的元素,该元素有一个带有"received" 文本的子元素
//div[contains(text(),"Review") and div[contains(text(),"received")]]
【讨论】:
保重,你离任务越近')'
//div[contains(text(),"Review") and contains(text(),"received")]
但这不是好的 xpath,因为“received”在内部元素上
试试这个,.//* 表示任何子元素,可以在第二个包含时使用 ./div
//div[.//*[contains(text(),"Review")] and .//*[contains(text(),"received")]]
或
//div[contains(text(),"Review") and .//*[contains(text(),"received")]]
【讨论】: