Java HTML Parse Jsoup getDoc(Connection conn)

Here you can find the source of getDoc(Connection conn)

Description

get Doc

License

Apache License

Declaration

public static Document getDoc(Connection conn) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.IOException;
import org.jsoup.Connection;

import org.jsoup.nodes.Document;

public class Main {
    public static Document getDoc(Connection conn) {
        Document doc = null;/*from w  w  w .  j  a  v  a2 s.  c  om*/
        int retry = 0;
        IOException e1 = null;
        while (retry++ < 3) {
            try {
                doc = conn.get();
                return doc;
            } catch (IOException e) {
                e1 = e;
                System.out.println("retry:" + retry);
            }
        }
        throw new RuntimeException(e1);

    }
}

Related

  1. extractRssUrl(String html, URI base)
  2. filter(String html)
  3. fixHtml(String htmlContent, String outputFile, String contentFile)
  4. getContentFromHTML(String html)
  5. getDistinctImageUrls(String htmlContent)
  6. getDoc(File file)
  7. getDoc(String path)
  8. getDoc(String url)
  9. getDoctypeName(InputStream s)