使用硒网络驱动程序从网页中检索元描述的内容
2022-09-04 20:39:33
想要使用网络驱动程序获取页面元描述的内容。
假设,从下面 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());
但是上面的代码对我不起作用。