/** * Get the combined outer HTML of all matched elements. Alias of {@link #outerHtml()}. * @return string of all element's outer HTML. * @see #text() * @see #html() */ @Override public String toString() { return outerHtml(); }
public String $html(String selector, boolean isOuter) { Elements elements = $(selector); if (elements != null) { if(isOuter) { return elements.outerHtml(); } return elements.html(); } return null; }
return null; String main = e2.select("main-classification").outerHtml().replaceAll("\n", "") .replaceAll("<main-classification>", "").replaceAll("</main-classification>", "") .replaceFirst(" ", ""); //Replace first space - not significant, always present. But SECOND space is important
Elements cleanLinks = elements.not("a[href$=S1]"); System.out.println(cleanLinks.outerHtml()); ... <a href="not_foo.html">not foo</a>
Document doc = Jsoup.parse(html); Elements e = doc.getElementsByTag("body"); Log.i("Span element: "+e.get(0).nodeName(), ""+e.get(0).nodeName()); e = e.get(0).getElementsByTag("span"); Attributes styleAtt = e.get(0).attributes(); Attribute a = styleAtt.asList().get(0); if(a.getKey().equals("style")){ String[] items = a.getValue().trim().split(";"); String newValue = ""; for(String item: items){ if(item.contains("COLOR:")||item.contains("FONT-SIZE:")){ Log.i("Style Item: ", ""+item); newValue = newValue.concat(item).concat(";"); } } a.setValue(newValue); Log.i("New Atrrbute: ",""+newValue); } Log.i("FINAL HTML: ",""+e.outerHtml()); doc.html(e.outerHtml()); }
private String modifyDataForClassParam(Document document) throws ProcessingException { String result; Elements elements = document.getElementsByClass(elementClass); if (!elements.isEmpty()) { result = elements.outerHtml(); } else { throw new ProcessingException("No element with class=" + elementClass + " found!"); } return result; }
private String modifyDataForClassParam(Document document) throws ProcessingException { String result; Elements elements = document.getElementsByClass(elementClass); if (!elements.isEmpty()) { result = elements.outerHtml(); } else { throw new ProcessingException("No element with class=" + elementClass + " found!"); } return result; }
.outerHtml()); if (considerSystemCaseLogs) { CaseLogPair logPair = caseLogs.remove(0);