我正在使用 JSoup 从亚马逊的特定网页中检索评论,我现在拥有的是:
Document doc = Jsoup.connect("http://www.amazon.com/Presto-06006-Kitchen-Electric-Multi-Cooker/product-reviews/B002JM202I/ref=sr_1_2_cm_cr_acr_txt?ie=UTF8&showViewpoints=1").get();
String title = doc.title();
Element reviews = doc.getElementById("productReviews");
System.out.println(reviews);
这给了我包含评论的 html 块,但我只想要没有所有标签 div 等的文本。然后我想将所有这些信息写入文件。我怎样才能做到这一点?谢谢!