Это должно получить обзорный текст на всех трех веб-страницах
// Get the overview div
Element overview = doc.select("div#object-overview").last();
// Get the paragraph element
Element paragraph = overview.select("p").last();
System.out.println(paragraph.text());
Что касается различных селекторов для разных веб-страниц, вы можете сделать что-то вроде HashMap.
// Create new HashMap
HashMap<String, String> selectorMap = new HashMap<String, String>();
// Put the Key-Value pair in the Hashmap
selectorMap.put("http://wii.gamespy.com/wii/ben-10-galactic-racing/", "div#object-overview");
// Get the value by supplying the key (the webpage's url)
String selector = selectorMap.get("http://wii.gamespy.com/wii/ben-10-galactic-racing/");
Дайте мне знатьесли это то, что вы искали.
Чтобы получить список возможностей:
// Get the overview div element
Element featureList = doc.select("div.callout-box").last();
Elements features = featureList.select("li");
ListIterator<Element> featList = features.listIterator();
while (featList.hasNext()) {
System.out.println(featList.next().text() + "\n");
}
Чтобы получить список выпусков:
// Get the div.columns element - this is the base of each edition
Elements editions = doc.select("div.columns");
ListIterator<Element> editionsList = editions.listIterator();
while (editionsList.hasNext()) {
// Get that edition
Element edition = editionsList.next();
// Get the edition name element
Element editionName = edition.select("h3").first();
System.out.println(editionName.text());
// Get the edition info element
Element editionInfo = edition.select("p").last();
System.out.println(editionInfo.text() + "\n");
}