【发布时间】:2016-01-06 15:54:52
【问题描述】:
我有一些这样的html:
<a>This is the Children's Miracle Network</a>
当我这样做时,正如预期的那样,我得到了一个错误
WebElement ele = driver.findElement(By.xpath("//a[contains(text(),'This is the Children's Miracle Network)]"));
因为 Children's 中的撇号取消了对文本的引用。我尝试使用双'(如'')和反斜杠(\'),但这不起作用。我不知道该怎么办?有什么建议吗?
【问题讨论】: