本文整理汇总了Java中org.jsoup.nodes.Document.body方法的典型用法代码示例。如果您正苦于以下问题:Java Document.body方法的具体用法?Java Document.body怎么用?Java Document.body使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jsoup.nodes.Document
的用法示例。
在下文中一共展示了Document.body方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: meiyuxsCatalog
import org.jsoup.nodes.Document; //导入方法依赖的package包/类
private static Map meiyuxsCatalog(Map map, String url) {
try {
List data = new ArrayList();
Document document = Jsoup
.connect(url)
.userAgent(FormatUtil.USER_AGENT_PC)
.get();
Element body = document.body();
Elements catalogEles = body.getElementsByClass("list-group-item");
for (Element catalogE : catalogEles) {
if (catalogE.getElementsByTag("a").size() > 0) {
Map<String, Object> _map = new HashMap<>();
_map.put("catalog", catalogE.text());
_map.put("href", "http://www.meiyuxs.com" + catalogE.getElementsByTag("a").first().attr("href"));
data.add(_map);
}
}
map.put("data", data);
map.put("cover", "");
map.put("lastChapter", ((Map) data.get(data.size() - 1)).get("catalog").toString());
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
示例2: sanjianggeCatalog
import org.jsoup.nodes.Document; //导入方法依赖的package包/类
private static Map sanjianggeCatalog(Map map, String url) {
try {
List data = new ArrayList();
Document document = Jsoup
.connect(url)
.userAgent(FormatUtil.USER_AGENT_PC)
.get();
Element body = document.body();
Elements catalogEles = body.getElementById("list").getElementsByTag("dd");
for (Element catalogE : catalogEles) {
if (catalogE.getElementsByTag("a").size() > 0) {
Map<String, Object> _map = new HashMap<>();
_map.put("catalog", catalogE.text());
_map.put("href", url + catalogE.getElementsByTag("a").first().attr("href"));
data.add(_map);
}
}
String cover = body.getElementById("fmimg").getElementsByTag("img").first().attr("src");
map.put("data", data);
map.put("cover", cover);
map.put("lastChapter", ((Map) data.get(data.size() - 1)).get("catalog").toString());
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
示例3: boluxsCatalog
import org.jsoup.nodes.Document; //导入方法依赖的package包/类
private static Map boluxsCatalog(Map map, String url) {
try {
List data = new ArrayList();
Document document = Jsoup
.connect(url)
.userAgent(FormatUtil.USER_AGENT_PC)
.get();
Element body = document.body();
Elements catalogEles = body.getElementsByClass("article_texttitleb").last().getElementsByTag("li");
for (Element catalogE : catalogEles) {
Map<String, Object> _map = new HashMap<>();
_map.put("catalog", catalogE.text());
_map.put("href", url + catalogE.getElementsByTag("a").attr("href"));
data.add(_map);
}
String cover = body.getElementsByClass("img").first().getElementsByTag("img").first().attr("src");
map.put("data", data);
map.put("cover", cover);
map.put("lastChapter", ((Map) data.get(data.size() - 1)).get("catalog").toString());
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
示例4: qulaCatalog
import org.jsoup.nodes.Document; //导入方法依赖的package包/类
private static Map qulaCatalog(Map map, String url) {
try {
List data = new ArrayList();
Document document = Jsoup
.connect(url)
.userAgent(FormatUtil.USER_AGENT_PC)
.get();
Element body = document.body();
Elements catalogEles = body.getElementById("list").getElementsByTag("dd");
for (Element catalogE : catalogEles) {
if (catalogE.getElementsByTag("a").size() > 0) {
Map<String, Object> _map = new HashMap<>();
_map.put("catalog", catalogE.text());
_map.put("href", url + catalogE.getElementsByTag("a").first().attr("href"));
data.add(_map);
}
}
String cover = body.getElementById("fmimg").getElementsByTag("img").first().attr("src");
map.put("data", data);
map.put("cover", cover);
map.put("lastChapter", ((Map) data.get(data.size() - 1)).get("catalog").toString());
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
示例5: getSeItemContentBody
import org.jsoup.nodes.Document; //导入方法依赖的package包/类
private static Element getSeItemContentBody(SeItem item) {
Document doc;
Element body = null;
try {
doc = Jsoup.connect(item.getId().toString()).get();
body = doc.body();
} catch (IOException e) {
LOG.debug("Failed to parse se-item '{}'", item.getName());
}
return body;
}