List of usage examples for org.jsoup.select Elements hasClass
public boolean hasClass(String className)
From source file:com.dalthed.tucan.scraper.SingleEventScraper.java
/** * /*from w w w .j a v a 2 s . c o m*/ */ private void scrapeInformations(Iterator<Element> informationIterator) { while (informationIterator.hasNext()) { Element nextElement = informationIterator.next(); Elements td = nextElement.select("td"); if (td != null && td.hasClass("tbdata")) { Elements Paragraphs = nextElement.select("p"); Iterator<Element> PaIt = Paragraphs.iterator(); ArrayList<String> titles = new ArrayList<String>(); ArrayList<String> values = new ArrayList<String>(); while (PaIt.hasNext()) { Element next = PaIt.next(); String[] information = crop(next.html()); if (information[1].length() > 0) { titles.add(information[0]); values.add(information[1]); } } Log.i(LOG_TAG, "Informationscraper working"); if (mPageAdapter != null) { Log.i(LOG_TAG, "InformationAdapter set"); mPageAdapter.setAdapter(new TwoLinesAdapter(context, titles, values)); } } } }