public abstract class AbstractContentExtractor extends Object implements ContentExtractor
| Modifier and Type | Field and Description |
|---|---|
protected ExtractRule |
contentRule |
| Constructor and Description |
|---|
AbstractContentExtractor(ExtractRule contentRule) |
| Modifier and Type | Method and Description |
|---|---|
Object |
extract(Page page)
提取数据
|
protected abstract Object |
extract(Page page,
List<ExtractFieldRule> fieldExtractRules)
根据提取规则对输入数据进行提取
|
String |
getName()
获取内容提取器的名字
|
protected ExtractRule contentRule
public AbstractContentExtractor(ExtractRule contentRule)
public Object extract(Page page)
extract in interface ContentExtractorpage - 下载后的网页对象protected abstract Object extract(Page page, List<ExtractFieldRule> fieldExtractRules)
page - 下载后的网页对象fieldExtractRules - 已经按照从小到大排列好的提取规则public String getName()
ContentExtractorgetName in interface ContentExtractorCopyright © 2020 Pivotal Software, Inc.. All rights reserved.