Commit 0c07ae33 by Jinhao Chen

Update README.md

parent b2a6e13e
# 知微数据可视化爬虫平台
项目主页: http://crawler.zhiweidata.com
部署服务器: 115.236.73.176/192.168.0.121
部署目录: ~/crawler_platform
目录介绍: 客户端(crawler_platform/client)、服务端(crawler_platform/server)、测试端(crawler_platform/test)、WEB端(crawler_platform/pannel)
# 知微数据可视化爬虫平台使用手册
>## 1 配置简介
>>### 1.1 解析器简介
>>> 目前解析器一共有6种解析器,分别是:Appender 解析器,JSONPath 解析器,Jsoup 解析器,XPath 解析器,Regex 解析器,Time 解析器,Helper 解析器,Assert 解析器,AssertFilter 解析器,未来可能会持续增加,解析器格式如下:
......@@ -74,6 +70,9 @@
>>>> |$macro.$timestamp.s|输出当前时间戳(秒级)|
>>>> |$macro.$timestamp.ms|输出当前时间戳(毫秒级)|
>>>> |$macro.$timeformat.yyyy-MM-dd|当前时间的格式化形式,yyyy-MM-dd 为自定义时间 pattern|
>>>> |$request.$headers.user-agent|当前请求头信息,user-agent 为自定义头信息名称|
>>>> |$response.code|当前响应 HTTP 码|
>>>> |$response.$headers.length|当前响应头信息,length 为自定义头信息名称|
>>>> 例:
>>>> ```
"url": [
......@@ -319,7 +318,16 @@
>>>>```
>>>> 上述规则支持解析2015年6月30日或20150630的形式或包含英文日期格式
>>>#### 1.1.7 Helper 解析器
>>>> Helper 解析器支持的 parsingType 有:fixurl,javascript,articleExtract,urlEncoder, urlDecoder 其中 command 支持所有宏(一般用 $self.url 或 $pre.self.url)与普通字符串
>>>> Helper 解析器支持的 parsingType 有:autoMatch, fixurl,javascript,articleExtract,urlEncoder, urlDecoder、md5 其中 command 支持所有宏(一般用 $self.url 或 $pre.self.url)与普通字符串
>>>>##### autoMath:仅可在表规则中使用,表示解析匹配组件模版,例:
>>>>```
[
{
"parserName": "helper",
"parsingType": "autoMatch"
}
]
>>>>```
>>>>##### fixurl:根据上次访问的 URL,结合输入(绝对或相对 URL),生成一个新的绝对 URL,例:
>>>>```
"url": [
......@@ -351,6 +359,12 @@
]
>>>>```
>>>> 结果为 test = 122
>>>> 如果需要访问多个上下文数据,请使用变量声明域,变量声明域即在 js 代码前添加注释信息:
>>>>```
>>>> /*{"abc": "$pre.title", "url": "$self.url"}*/
>>>> return abc+url;
>>>>```
>>>> abc 变量为上下文命令对应 $pre.title 的值,url 变量为上下文命令 $self.url 对应的值,数据类型均为字符串
>>>>##### articleExtract:将上文传递过来的数据进行正文提取,例如:
>>>>```
"text": [
......@@ -397,7 +411,22 @@
}
]
>>>>```
>>>> 结果为 text = 知微数据
>>>>##### md5:将上文传递过来的数据进行 md5 计算,command 为字符串解码字符集,例如:
>>>>```
"text": [
{
"parserName": "appender",
"parsingType": "overwrite",
"command": "123456"
},
{
"parserName": "helper",
"parsingType": "md5",
"command": "utf-8"
}
]
>>>>```
>>>> 结果为 text = e10adc3949ba59abbe56e057f20f883e(著名弱密码 123456 的 md5 )
>>>#### 1.1.8 Assert 解析器
>>>> Assert 解析器支持的 parsingType 有:hoursLimit,minutesLimit,contains,matches,notEmpty 六种解析类型,通过 Assert 解析器,符合条件的数据最终会被保留,这里请注意与 AssertFilter 相反
>>>>##### hoursLimit、minutesLimit:针对时间进行小时级、分钟级限制,例:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment