8
想要使用webdriver获取页面元描述的内容。使用selenium webdriver从网页中检索元描述的内容
让说,从下面DOM要检索的文本 Test.com provides a complete software solution for creating online tests and managing enterprise and specialist certification programs, in up to 22 languages
<script src="content/js/jquery.min.js">
<meta content="Test.com provides a complete software solution for creating online tests and managing enterprise and specialist certification programs, in up to 22 languages." name="description">
<meta content="Test.com" name="keywords">
我试着用
System.out.println(driver.findElement(By.xpath("//meta[@name='description']")).getText());
但上面的代码不会为我工作。