public static String getDesc(Document doc) { String desc = ""; Elements element_contents_all = doc.select("h1,h2,blockquote,p"); for (Element element : element_contents_all) { desc += element.text() + " "; if (desc.length() >= 400) { logger.info("\t內容超過400字,中止抽取。"); logger.info(desc); break; } } return desc; }