Java HTML Jsoup Document formatDocument(Document doc)

Here you can find the source of formatDocument(Document doc)

Description

format Document

License

Open Source License

Declaration

public static Document formatDocument(Document doc) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import org.jsoup.nodes.Document;

public class Main {

    public static Document formatDocument(Document doc) {
        doc.getElementsByTag("script").remove();
        doc.getElementsByTag("link").attr("rel", "stylesheet").remove();
        doc.getElementsByTag("style").remove();
        doc.getElementsByTag("img").addClass("img-responsive");
        return doc;
    }/*from ww  w  . java 2 s.  c  om*/
}

Related

  1. applyCacheKeysToResourceUrls(Document document, long pluginModifiedTimestamp, Locale locale)
  2. convertLinksToAbsolute(String link, org.jsoup.nodes.Document doc)
  3. detectLanguage(Document doc)
  4. emptyDocument()
  5. getAllText(Document document)
  6. getCategoryIds(final Document html)
  7. getContainersForLink(Document document, String link)
  8. getDivForClass(Document document, String className)