List of usage examples for org.jsoup.nodes Document empty
public Element empty()
From source file:com.dajodi.scandic.JSoupScraper.java
@Override public Map<String, String> scrapeFormInputFields(InputStream inStream) { try {/*from ww w .j av a2s .c o m*/ Document doc = Jsoup.parse(inStream, HTTP.UTF_8, ""); Element form = doc.body().getElementById("aspnetForm"); Elements inputNodes = form.getElementsByTag("input"); Map<String, String> inputMap = new HashMap<String, String>(); for (Element element : inputNodes) { String name = element.attr("name"); String value = element.attr("value"); if (name != null) { inputMap.put(name, value == null ? "" : value); } else { //TODO: remove me Log.d("Something weird"); } } doc.empty(); return inputMap; } catch (Exception e) { throw new ScandicHtmlException(e); } }