jsoup
uses css based selectors, hence your grid grid-pad
would translate to grid-pad
itself.
Now there seems to be a flaw in the code where grid-pad
and col-1-1
do not cover the repetitive divs
for the textual content you are looking for.
However, changing your selector to text
and archive_box
seem to do the trick as all of the content is within this div with css selector archive_box
.
Hence your code skips 1 loop and just loops over text
, like this:
try {
Document doc = Jsoup.connect("http://multiplayer.it/articoli/")
.get();
Elements sezioni = doc.getElementsByClass("archive_box");
for (Element riga : sezioni) {
Element info = riga.getElementsByClass("text").first();
String titolo = riga.getElementsByTag("h2").first().text();
System.out.println(titolo);
String date = info.getElementsByClass("date").first().text();
System.out.println(date);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The output would be:
Carmageddon è gratuito per un giorno su App Store e Google Play
circa un'ora fa
Paradox Interactive annuncia Runemaster
circa un'ora fa
Annunciato Hearts of Iron IV
circa un'ora fa
...