文本属于两个不同的标签。您可以查找带有
"Review"
文本的元素,该元素的子元素带有 "received"
文本
//div[contains(text(),"Review") and div[contains(text(),"received")]]
保重,你离任务越近')'
//div[contains(text(),"Review") and contains(text(),"received")]
但这不是好的 xpath,因为“已收到”位于内部元素上
试试这个,.//* 表示任何子元素,可以在第二个包含上使用 ./div
//div[.//*[contains(text(),"Review")] and .//*[contains(text(),"received")]]
或
//div[contains(text(),"Review") and .//*[contains(text(),"received")]]