0
我们试图通过Google返回的搜索结果页面的html来检索图像的最佳猜测。 我们知道图像的最佳猜测具有类qb-b,所以我们尝试使用.select方法选择带'a'标签的元素。然而,当我们打印使用jsoup的get方法检索到的文档时,文档不包含任何“最佳猜测”字符串。如何检索来自html的图像的最佳猜测google google jsoup
我们写的代码如下。我们如何解决它?
String newUrl = connect1.getHeaderField("Location");
Document doc = Jsoup.connect(newUrl.toString()).get();
Elements bestguess = doc.select("a.qb-b");
System.out.println(bestguess.toString());