Handling connection errors and JSoup
问题 I'm trying to create an application to scrape content off of multiple pages on a site. I am using JSoup to connect. This is my code: for (String locale : langList){ sitemapPath = sitemapDomain+"/"+locale+"/"+sitemapName; try { Document doc = Jsoup.connect(sitemapPath) .userAgent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21") .timeout(10000) .get(); Elements element = doc.select("loc"); for (Element urls : element) { System.out