更新时间:2021-12-11 22:39:36
可以使用Xpaths获取,代码如下:
You can use Xpaths to get it, Please find the code below:
WebElement eleText=driver.findElement(By.xpath("//strong[contains(text(),'Telephone:')]"));
String textTelephone=eleText.getText();
System.out.println(textTelephone);
您可以使用另一个类似的 xpath
You can use another xpath like that
WebElement eleText=driver.findElement(By.xpath("//*[contains(text(),'Telephone:')]"));
String textTelephone=eleText.getText();
System.out.println(textTelephone);