Java HTML Parse Jsoup getDoc(String url)

Here you can find the source of getDoc(String url)

Description

get Doc

License

Open Source License

Declaration

public static Document getDoc(String url) 

Method Source Code


//package com.java2s;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.io.IOException;

public class Main {

    public static Document getDoc(String url) {
        try {//from  w ww  . j a v  a  2 s .  c  o m
            Document document = Jsoup.connect(url).timeout(10000).get();
            if (document == null) {
                document = Jsoup.connect(url).timeout(10000).get();
            }
            return document;
        } catch (IOException e) {
            System.out.println("get document error," + e.getMessage());
        }
        return null;
    }
}

Related

  1. getContentFromHTML(String html)
  2. getDistinctImageUrls(String htmlContent)
  3. getDoc(Connection conn)
  4. getDoc(File file)
  5. getDoc(String path)
  6. getDoctypeName(InputStream s)
  7. getErrorMessage(String htmlStr)
  8. getExplanation(String html)
  9. getFirstImageSrc(String html)