博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
(转载)Htmlparser Filter 简要归纳
阅读量:4602 次
发布时间:2019-06-09

本文共 3298 字,大约阅读时间需要 10 分钟。

1 . 逻辑关系:与或非

 

()           Creates a new instance of an AndFilter.
([] predicates)           Creates an AndFilter that accepts nodes acceptable to all given filters.
( left,  right)           Creates an AndFilter that accepts nodes acceptable to both filters.

 

 

 

()           Creates a new instance of an OrFilter.
([] predicates)           Creates an OrFilter that accepts nodes acceptable to any of the given filters.
( left,  right)           Creates an OrFilter that accepts nodes acceptable to either filter.

 

 

 

()           Creates a new instance of an OrFilter.
([] predicates)           Creates an OrFilter that accepts nodes acceptable to any of the given filters.
( left,  right)           Creates an OrFilter that accepts nodes acceptable to either filter.

 

2. 内容

StringFilter:功能简单有限;复杂功能可使用RegexFilter (正则表达式)

 

()           Creates a new instance of StringFilter that accepts all string nodes.
( pattern)           Creates a StringFilter that accepts text nodes containing a string.
( pattern, boolean sensitive)           Creates a StringFilter that accepts text nodes containing a string.
( pattern, boolean sensitive,  locale)           Creates a StringFilter that accepts text nodes containing a string.

 

 

()           Creates a new instance of RegexFilter that accepts string nodes matching the regular expression ".*" using the FIND strategy.
( pattern)           Creates a new instance of RegexFilter that accepts string nodes matching a regular expression using the FIND strategy.
( pattern, int strategy)           Creates a new instance of RegexFilter that accepts string nodes matching a regular expression.

 

 

3 标签

TagNameFilter()利用标签名过滤 : div ,img , ...

NodeClassFilter()利用标签类别 :LinkTag.class ...

HasAttributeFilter()利用属性 :(, )

LinkRegexFilter()用正则表达式匹配链接

 

()           Creates a new instance of TagNameFilter.
( name)           Creates a TagNameFilter that accepts tags with the given name.

 

 

()           Creates a NodeClassFilter that accepts Html tags.
( cls)           Creates a NodeClassFilter that accepts tags of the given class.
()           Creates a new instance of HasAttributeFilter.
( attribute)           Creates a new instance of HasAttributeFilter that accepts tags with the given attribute.
( attribute,  value)           Creates a new instance of HasAttributeFilter that accepts tags with the given attribute and value.
( regexPattern)           Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern.
( regexPattern, boolean caseSensitive)           Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern.
( pattern)           Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.
( pattern, boolean caseSensitive)           Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern.

 

 

4 层次关系

 

()           Creates a new instance of HasParentFilter.
( filter)           Creates a new instance of HasParentFilter that accepts nodes with the direct parent acceptable to the filter.
( filter, boolean recursive)           Creates a new instance of HasParentFilter that accepts nodes with a parent acceptable to the filter.

 

 

()           Creates a new instance of a HasChildFilter.
( filter)           Creates a new instance of HasChildFilter that accepts nodes with a direct child acceptable to the filter.
( filter, boolean recursive)           Creates a new instance of HasChildFilter that accepts nodes with a child acceptable to the filter.

 

原博出处:

转载于:https://www.cnblogs.com/WonderHow/p/3304284.html

你可能感兴趣的文章
Spring 3.1.0 Hibernate 3.0 Eclipse Spring WEB例子
查看>>
UVA-10212 The Last Non-zero Digit. 分解质因子+容斥定理
查看>>
求两个集合的交集,并集,差集
查看>>
Kotlin的语法糖(一)基础篇
查看>>
OkHttp源码分析
查看>>
让你的app体验更丝滑的11种方法!冲击手机应用榜单Top3指日可待
查看>>
windows kernel exploitation基础教程
查看>>
NS_OPTIONS枚举的用法
查看>>
java9系列(九)Make G1 the Default Garbage Collector
查看>>
QAQ高精度模板笔记√
查看>>
Jmeter计数器的使用-转载
查看>>
【Android笔记】入门篇02:全屏设置和禁止横屏竖屏切换
查看>>
Kubernetes的本质
查看>>
PL/SQL developer 管理多套数据库
查看>>
黑马程序员-分类(category)
查看>>
vue-cli多页面
查看>>
进程和线程
查看>>
iOS Foundation框架简介 -1.常用结构体的用法和输出
查看>>
libevent reference Mannual I
查看>>
eclipse创建Maven父子结构Maven项目
查看>>