【发布时间】:2014-03-08 03:32:10
【问题描述】:
如何使用 selenium 网络驱动程序获取此跨度的文本值。
<div itemtype="http://schema.org/LocalBusiness" style="float: left;">
<span itemprop="name" style="color: #c71d22; font-size: 14px;">
<b>Das Fiscaal</b>
</span><br>
我尝试使用此代码,但它不起作用。请任何帮助。
String kk = driver.findElement(By.xpath("//*div[@itemtype='http://schema.org/LocalBusiness']/div/span[@itemprop='name']")).getText();
【问题讨论】: