(转载)Htmlparser Filter 简要归纳
1 . 逻辑关系:与或非
AndFilter() Creates a new instance of an AndFilter. |
AndFilter(NodeFilter[] predicates) Creates an AndFilter that accepts nodes acceptable to all given filters. |
AndFilter(NodeFilter left, NodeFilter right) Creates an AndFilter that accepts nodes acceptable to both filters. |
OrFilter() Creates a new instance of an OrFilter. |
OrFilter(NodeFilter[] predicates) Creates an OrFilter that accepts nodes acceptable to any of the given filters. |
OrFilter(NodeFilter left, NodeFilter right) Creates an OrFilter that accepts nodes acceptable to either filter. |
OrFilter() Creates a new instance of an OrFilter. |
OrFilter(NodeFilter[] predicates) Creates an OrFilter that accepts nodes acceptable to any of the given filters. |
OrFilter(NodeFilter left, NodeFilter right) Creates an OrFilter that accepts nodes acceptable to either filter. |
2. 内容
StringFilter:功能简单有限;复杂功能可使用RegexFilter (正则表达式)
StringFilter() Creates a new instance of StringFilter that accepts all string nodes. |
StringFilter(String pattern) Creates a StringFilter that accepts text nodes containing a string. |
StringFilter(String pattern, boolean sensitive) Creates a StringFilter that accepts text nodes containing a string. |
StringFilter(String pattern, boolean sensitive, Locale locale) Creates a StringFilter that accepts text nodes containing a string. |
RegexFilter() Creates a new instance of RegexFilter that accepts string nodes matching the regular expression ".*" using the FIND strategy. |
RegexFilter(String pattern) Creates a new instance of RegexFilter that accepts string nodes matching a regular expression using the FIND strategy. |
RegexFilter(String 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()利用属性 :HasAttributeFilter(“class”, “className”)
LinkRegexFilter()用正则表达式匹配链接
TagNameFilter() Creates a new instance of TagNameFilter. |
TagNameFilter(String name) Creates a TagNameFilter that accepts tags with the given name. |
NodeClassFilter() Creates a NodeClassFilter that accepts Html tags. |
NodeClassFilter(Class cls) Creates a NodeClassFilter that accepts tags of the given class. |
HasAttributeFilter() Creates a new instance of HasAttributeFilter. |
HasAttributeFilter(String attribute) Creates a new instance of HasAttributeFilter that accepts tags with the given attribute. |
HasAttributeFilter(String attribute, String value) Creates a new instance of HasAttributeFilter that accepts tags with the given attribute and value. |
LinkRegexFilter(String regexPattern) Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern. |
LinkRegexFilter(String regexPattern, boolean caseSensitive) Creates a LinkRegexFilter that accepts LinkTag nodes containing a URL that matches the supplied regex pattern. |
LinkStringFilter(String pattern) Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern. |
LinkStringFilter(String pattern, boolean caseSensitive) Creates a LinkStringFilter that accepts LinkTag nodes containing a URL that matches the supplied pattern. |
4 层次关系
HasParentFilter() Creates a new instance of HasParentFilter. |
HasParentFilter(NodeFilter filter) Creates a new instance of HasParentFilter that accepts nodes with the direct parent acceptable to the filter. |
HasParentFilter(NodeFilter filter, boolean recursive) Creates a new instance of HasParentFilter that accepts nodes with a parent acceptable to the filter. |
HasChildFilter() Creates a new instance of a HasChildFilter. |
HasChildFilter(NodeFilter filter) Creates a new instance of HasChildFilter that accepts nodes with a direct child acceptable to the filter. |
HasChildFilter(NodeFilter filter, boolean recursive) Creates a new instance of HasChildFilter that accepts nodes with a child acceptable to the filter. |
原博出处:http://blog.sina.com.cn/s/blog_4a2cf9700100hqj9.html
(转载)Htmlparser Filter 简要归纳的更多相关文章
- CSS IE6/7/8, Firefox, Safari, Chrome, Opera Hack使用简要归纳(转)
网上有很多关于IE6/7/8, Firefox, Safari, Chrome, Opera CSS Hack的文章,但我觉得太过繁杂,要不给出一张看也看不懂的CSS Hack归纳表,要不就是给出一大 ...
- 转载 angularJS filter 过滤器
angularjs中的filter(过滤器) 标签: angularjsfilter 源文地址:http://www.ncloud.hk/技术分享/angularjs中的filter-过滤器/ f ...
- 布隆过滤器(Bloom Filter)简要介绍
一种节省空间的概率数据结构 布隆过滤器可以理解为一个不怎么精确的 set 结构,当你使用它的 contains 方法判断某个对象是否存在时,它可能会误判.但是布隆过滤器也不是特别不精确,只要参数设置的 ...
- httpparase + httpclient 的运用
这篇文章介绍了 HtmlParser 开源包和 HttpClient 开源包的使用,在此基础上实现了一个简易的网络爬虫 (Crawler),来说明如何使用 HtmlParser 根据需要处理 Inte ...
- HtmlParser应用,使用Filter从爬取到的网页中获取需要的内容
htmlparser是一个纯的java写的html解析的库,它不依赖于其它的java库文件,主要用于改造或提取html.它能超高速解析html,而且不会出错.现在htmlparser最新版本为2.0. ...
- asp.net、mvc、ajax、js、jquery、sql、EF、linq、netadvantage第三方控件知识点笔记
很简单,如下: 父页面:(弹出提示框) function newwindow(obj) { var rtn = window.showModalDialog('NewPage.htm','','sta ...
- XSD详解三 - 复合元素+总结篇
一.复合元素介绍 1.什么是复合元素? 复合元素指包含其他元素及/或属性的 XML 元素. 有四种类型的复合元素: 空元素 包含其他元素的元素 仅包含文本的元素 包含元素和文本的元素 注释:上述元素均 ...
- java_io
JAVA IO流(一)参考文章:http://ifeve.com/java-io-network/,并发编程网原创文章,转载请注明: 转载自并发编程网 – ifeve.com本文链接地址: Java ...
- 个人CKeditor的config.js配置
/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For lic ...
随机推荐
- Http报头Accept与Content-Type的区别
Http报头Accept与Content-Type的区别 1.Accept属于请求头, Content-Type属于实体头. Http报头分为通用报头,请求报头,响应报头和实体报头. 请求方的http ...
- MVC HtmlHelper用法大全
MVC HtmlHelper用法大全HtmlHelper用来在视图中呈现 HTML 控件.以下列表显示了当前可用的一些 HTML 帮助器. 本主题演示所列出的带有星号 (*) 的帮助器. ·Actio ...
- HTML JSP Servlet 的 相对路径 绝对路径
HTML 相对路径 - 没有最前面的 /: 相对于当前文件,和OS一样 绝对路径 - 前面带 / : 相对于 http://<host>:port/ Servlet 相对路径 - 相对于 ...
- 手把手ssm+idea
https://github.com/judasn/Basic-Multi-Module-SSM https://github.com/liyifeng1994/ssm
- bottomNavigationBar 底部导航tab MD
1.先上图: 此底部Tab完全可以满足日常的开发 2.使用: 很简单,使用Gradle构建:compile ‘com.ashokvarma.android:bottom-navigation-bar: ...
- qq 换密保方法 只要有密保就好换手机
特别提醒:必须先绑定手机再做其它操作!!否则有几率冻结更换密保手机号后审核时间2-12小时,请您确定审核通过后再使用(本链接所有号码不需要挂七天常用IP即可绑定手机后改密)电脑换绑定手机方法:复制账号 ...
- selenium 加载RemoteDriver浏览器驱动
title NodeWebDriver java -jar selenium-server-standalone-2.42.2.jar -Dwebdriver.ie.driver="C:\S ...
- English substitute
英语写作中替换掉用到发腻的↓常用词↓,吐血整理2小时~~ 动词替换: 1.Improve 提高: Promote: 促进AC之间的贸易 promote the trade between ...
- Mustache.js使用笔记(内容属于转载总结)
1.Mustache的语法很简单,用两个大括号标记要绑定的字段即可,“{{}}” Mustache主要的渲染方法为Mustache.render(),该方法有两个参数,第一个为要渲染的模版, 也就是例 ...
- 如何处理PHP和MYSQL的并发以及优化
sql优化,数据缓存和页面静态化首先各种优化程序逻辑优化数据库优化硬件横向扩展数据hash.服务器提升性能.表hash.出钱找oraclec出解决方案页面静态化:Php页面静态化有两种,第一,php模 ...