jsoup html
来源:互联网 发布:用手机装修淘宝店铺 编辑:程序博客网 时间:2024/04/30 00:41
http://jsoup.org/apidocs/ 处理html
public static void main(String[] args) {
String sql = test("test ");
System.out.println(sql);
String sql2 = test("test or 1 or 1=1");
System.out.println(sql2);
String html= "<a href='http://www.baidu.com'>test链接测试</a><IMG src='/uploadfiles/webedit/20070316023436859.gif'><IMG src='/uploadfiles/webedit/20070316023446921.gif'><IMG src='/webEditor2/sysimage/emot/10.gif'>";
String unhtml = unHtml(html);
System.out.println("unhtml:"+unhtml);
String _html = Html(unhtml);
System.out.println("html:"+_html);
}
static String test(String keyWord){
StringBuffer sql = new StringBuffer("select key_sn,remark,create_date from tb_selogon_key where 1=1 ");
if(StringUtils.isNotBlank(keyWord)){
sql.append(" and like '%" + org.apache.commons.lang.StringEscapeUtils.escapeSql(keyWord) + "%'");
}
return sql.toString();
}
//escapeHtml 转义 html脚本
static String unHtml(String htmlStr){
return org.apache.commons.lang.StringEscapeUtils.escapeHtml(htmlStr);
}
// unescapeHtml 反转义html脚本
static String Html(String htmlStr){
return org.apache.commons.lang.StringEscapeUtils.unescapeHtml(htmlStr);
}
- jsoup html
- HTML解析器 jsoup
- HTML解析器 jsoup
- jsoup 解析 html 学习
- jsoup解析html
- Jsoup解析HTML Demo
- HTML解析器 jsoup
- 利用Jsoup解析HTML
- jsoup 解析HTML 文档
- html解析工具。jsoup。
- Jsoup解析HTML文件
- Jsoup解析HTML,XML
- JSoup HTML解析器
- Jsoup解析html
- jsoup解析html
- jsoup操作html元素
- android jsoup解析html
- jsoup进行html处理
- HDOJ-1301-POJ-Jungle Roads
- POJ3621 Sightseeing Cows(最优比率环)
- java注解机制
- acmcoder1001:Sum Problem细节问题
- 时间复杂度
- jsoup html
- UI05 _ 播放MP3格式的歌曲
- 8-12
- 【工业串口和网络软件通讯平台(SuperIO)教程】五.二次开发图形显示界面
- C++里的组合与聚合关系
- 【Linux】yum安装lamp环境
- POJ 1903 Jurassic Remains -- 中途相遇法
- Service的使用(二)之与activity的通讯
- 黑马程序员------OC中类的声明和实现