Package org.jsoup.nodes

Examples of org.jsoup.nodes.Element.html()


     
      for (Element element : elements) {
        element.wrap(wrapHtml);
      }
     
      return body.html();
    } else {
      // nothing to update
      return content;
    }
  }
View Full Code Here


    if (elements.size() > 0) {
      for (Element element : elements) {
        element.remove();
      }
     
      return body.html();
    } else {
      // nothing changed
      return content;
    }
  }
View Full Code Here

        String headingId = generateUniqueId(ids, headingSlug);
       
        heading.attr("id", headingId);
      }
     
      return body.html();
    } else {
      // nothing to update
      return content;
    }
  }
View Full Code Here

     * @return
     */
    public static String removeTag(String html, String tagName) {
        Element bodyElement = Jsoup.parse(html).body();
        bodyElement.getElementsByTag(tagName).remove();
        return bodyElement.html();
    }

}
View Full Code Here

  {
    Element td = elemLin.parent();
    Elements elems = td.select("a:matches(Movie)");
    if (elems.size() == 0)
      throw new DownloadFailedException(PbnTools.getStr("error.noMovie",
        td.html()), m_ow, false);
    Element movieElem = elems.get(0);
    String sOnClick = movieElem.attr("onclick");
    if (sOnClick.length() == 0)
      throw new DownloadFailedException(PbnTools.getStr("error.noAttr",
        "onclick", movieElem.outerHtml()), m_ow, false);
View Full Code Here

            //The images are located in the 'script' part of the html
            Element script = doc.select("script").first();

            Pattern p = Pattern.compile("\"cdnUrl\":\"(.*?)\",");
            Matcher m = p.matcher(script.html());

            while (m.find())
            {
                String imgUrl = m.group(1);
                //System.out.print(imgUrl + " -> ");
View Full Code Here

  private void fixNode429() {
    if (! (origFile.getName().equals("node429.html") && pageTitle.contains("unix")))
      return;
    SimpleLogger.debug("Fixing buggy heading");
    Element buggyParagraph = findFirstElement(Selector.NODE429_BUGGY_PARAGRAPH);
    buggyParagraph.html("<h1><a>unix</a></h1>");
  }

  private void removeClutterAroundMainContent() {
    // Keep JavaScript for source code colouring ('prettyPrint' function) in some books
    // deleteNodes(Selector.SCRIPTS);
View Full Code Here

      clean.outputSettings(new OutputSettings().escapeMode(EscapeMode.base).prettyPrint(false));
      Element body = clean.body();
      if (keepTextOnly) {
        content = body.text();
      } else {
        content = body.html();
      }
    }
    return content;
  }
View Full Code Here

    } else if (node instanceof Element) {
      Element enode = (Element) node;
      String tagname = enode.tagName();
      String text = cleanOutControlChars(enode.text());
      String outerHTML = cleanOutControlChars(enode.outerHtml());
      String innerHTML = cleanOutControlChars(enode.html());
      Attributes attrs = enode.attributes();
      Map<String, String> attributeMap = new HashMap<String, String>();
      for (Attribute attr : attrs) {
        attributeMap.put(attr.getKey(), attr.getValue());
      }
View Full Code Here

        String methodName = docFile.getName().substring(0, docFile.getName().indexOf('_'));
        //System.out.println(methodName);
        for (Iterator it = elm.iterator(); it.hasNext();) {
          Element ele = (Element) it.next();
          msg = "<html><body> <strong><div style=\"width: 300px; text-justification: justify;\"></strong><table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"ref-item\">"
              + ele.html() + "</table></div></html></body></html>";         
          //mat.replaceAll("");
          msg = msg.replaceAll("img src=\"", "img src=\""
              + p5Ref.toURI().toURL().toString() + "/");
          //System.out.println(ele.text());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.