1. 利用Jsope来解析html code :
Document doc = Jsoup.parse(htmlCode);
Elements links = doc.select("script");
String text2 ="";
for (Element link : links)
{
text2 = link.toString();
text2 = text2.replaceAll(":", ":");
text2= text2.replaceAll("@", "@");
text2= text2.replaceAll("=", "=");
text2= text2.replaceAll(";", ";");
text2 =text2.replaceAll("%", "%");
break;
}
Elements links = doc.select("script");
String text2 ="";
for (Element link : links)
{
text2 = link.toString();
text2 = text2.replaceAll(":", ":");
text2= text2.replaceAll("@", "@");
text2= text2.replaceAll("=", "=");
text2= text2.replaceAll(";", ";");
text2 =text2.replaceAll("%", "%");
break;
}
2. Jsope 的官网:
3. Jsope(Jar, document)的下载地址:
http://jsoup.org/packages/jsoup-1.6.1-javadoc.jar
做个快乐的自己。