Package org.jsoup.nodes

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


                  Elements hrefs = document.getElementsByTag("a");
                  for(Element href : hrefs) {
                    String extant = href.attr("href");
                    href.attr("href", OUTPUT_NAME + "." + extant);
                  }
                    sink.rawText(document.html());
          /*
                  if(!styleDone) {
                        addElements(sink, document.head().getElementsByTag("link"));
                        addElements(sink, document.head().getElementsByTag("script"));
                        styleDone = true;
View Full Code Here


        try {
          Document doc = Jsoup.parse(new ByteArrayInputStream(response.content), null, url);

          if (htmlMapping == null) {
            return doc.html();
          } else {
            Map<String, String> ret = new HashMap<>();
            for (String dataField : htmlMapping.keySet()) {
              String value = null;
              Map<String, Object> fieldMappingConfig = htmlMapping.get(dataField);
View Full Code Here

                }
              } else {
                if (stripHtml) {
                  value = convertNodeToText(doc);
                } else {
                  value = doc.html();
                }
              }
              ret.put(dataField, value);
            }
            return ret;
View Full Code Here

        head.appendElement("link").attr("rel", "stylesheet").attr("type", "text/css").attr("href", "http://www.headjump.de/stylesheets/arrowsandboxes.css");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://code.jquery.com/jquery-1.4.1.min.js");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://www.headjump.de/javascripts/jquery_wz_jsgraphics.js");
        head.appendElement("script").attr("type", "text/javascript").attr("src", "http://www.headjump.de/javascripts/arrowsandboxes.js");
       
        return document.html();
    }

    @Override
    public String process(org.asciidoctor.ast.Document document, String output) {
        return null;
View Full Code Here

                    float r = Float.valueOf(DEFAULT_MAX_WIDTH)/w;
                    element.attr("height", String.valueOf((int)(h*r)));
                }
            }
        }
        return doc.html();
    }

}
View Full Code Here

        .attr("type", "text/javascript")
        .attr("charset", "utf-8");
    }
   
    //Create or update the script contents for this HTML file path
    ScriptCache cache = ScriptHash.updateScriptContents(path, scriptPathList, htmlDocument.html(), System.currentTimeMillis() + (maxCacheSeconds * 1000));
    logger.info("Finished extracting script contents took: " + (System.currentTimeMillis() - before) + " ms.");
   
    return cache;
  }

View Full Code Here

            {
                logger.log(Level.SEVERE, "Exception: " + url + " already exists", e);
            }
        }

        url.setDocument(document.html());
        url.setStatus(UrlStatus.SCANNED);
        url.setScannedOn(new Date());
    }
}
View Full Code Here

    @Override
    public void rip() throws IOException {
        logger.info("    Retrieving " + this.url);
        Document doc = Http.url(this.url).get();
        Pattern p = Pattern.compile("^.*var qualityArr = (.*});.*$", Pattern.DOTALL);
        Matcher m = p.matcher(doc.html());
        if (m.matches()) {
            try {
                JSONObject json = new JSONObject(m.group(1));
                String vidUrl = null;
                for (String quality : new String[] {"1080p", "720p", "480p", "240p"}) {
View Full Code Here

    @Override
    public void rip() throws IOException {
        logger.info("Retrieving " + this.url);
        Document doc = Http.url(url).get();
        List<String> mp4s = Utils.between(doc.html(), "file:\"", "\"");
        if (mp4s.size() == 0) {
            throw new IOException("Could not find files at " + url);
        }
        String vidUrl = mp4s.get(0);
        addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url));
View Full Code Here

                motherlessThreadPool.addThread(mit);
            }
            // Next page
            nextURL = null;
            page++;
            if (doc.html().contains("?page=" + page)) {
                nextURL = this.url.toExternalForm() + "?page=" + page;
            }
        }
        motherlessThreadPool.waitForThreads();
        waitForThreads();
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.