Jsoup
文章平均质量分 54
帅气的椅子
这个作者很懒,什么都没留下…
展开
-
爬虫时跳过证书
public class SSLHelper {public static String USER_AGENT = “Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 5.0)”;static public void init() {try {SSLContext context = SSLContext.getInstance(“TLSv1.2”);context.init(null, new X509TrustManager[]{new X509Tru原创 2021-02-26 09:56:18 · 270 阅读 · 0 评论 -
运用Jsoup写java爬虫下载文档
private static Document getDoc(String url) {Document doc = null;int loopCount = 0;while (true) {try {doc = Jsoup.connect(url).timeout(10000000).ignoreContentType(true).get();break;} catch (Exception e) {e.printStackTrace();}if (loopCount++ > 1原创 2021-02-26 09:48:15 · 205 阅读 · 0 评论