Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
crawler-template-manual
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangkai
crawler-template-manual
Commits
0c07ae33
Commit
0c07ae33
authored
Oct 08, 2021
by
Jinhao Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
b2a6e13e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
7 deletions
+36
-7
README.md
+36
-7
No files found.
README.md
View file @
0c07ae33
# 知微数据可视化爬虫平台
# 知微数据可视化爬虫平台使用手册
项目主页: 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.1 解析器简介
>>### 1.1 解析器简介
...
@@ -74,6 +70,9 @@
...
@@ -74,6 +70,9 @@
>>>> |$macro.$timestamp.s|输出当前时间戳(秒级)|
>>>> |$macro.$timestamp.s|输出当前时间戳(秒级)|
>>>> |$macro.$timestamp.ms|输出当前时间戳(毫秒级)|
>>>> |$macro.$timestamp.ms|输出当前时间戳(毫秒级)|
>>>> |$macro.$timeformat.yyyy-MM-dd|当前时间的格式化形式,yyyy-MM-dd 为自定义时间 pattern|
>>>> |$macro.$timeformat.yyyy-MM-dd|当前时间的格式化形式,yyyy-MM-dd 为自定义时间 pattern|
>>>> |$request.$headers.user-agent|当前请求头信息,user-agent 为自定义头信息名称|
>>>> |$response.code|当前响应 HTTP 码|
>>>> |$response.$headers.length|当前响应头信息,length 为自定义头信息名称|
>>>> 例:
>>>> 例:
>>>> ```
>>>> ```
"url":
[
"url":
[
...
@@ -319,7 +318,16 @@
...
@@ -319,7 +318,16 @@
>>>>```
>>>>```
>>>> 上述规则支持解析2015年6月30日或20150630的形式或包含英文日期格式
>>>> 上述规则支持解析2015年6月30日或20150630的形式或包含英文日期格式
>>>#### 1.1.7 Helper 解析器
>>>#### 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,例:
>>>>##### fixurl:根据上次访问的 URL,结合输入(绝对或相对 URL),生成一个新的绝对 URL,例:
>>>>```
>>>>```
"url":
[
"url":
[
...
@@ -351,6 +359,12 @@
...
@@ -351,6 +359,12 @@
]
]
>>>>```
>>>>```
>>>> 结果为 test = 122
>>>> 结果为 test = 122
>>>> 如果需要访问多个上下文数据,请使用变量声明域,变量声明域即在 js 代码前添加注释信息:
>>>>```
>>>> /*{"abc": "$pre.title", "url": "$self.url"}*/
>>>> return abc+url;
>>>>```
>>>> abc 变量为上下文命令对应 $pre.title 的值,url 变量为上下文命令 $self.url 对应的值,数据类型均为字符串
>>>>##### articleExtract:将上文传递过来的数据进行正文提取,例如:
>>>>##### articleExtract:将上文传递过来的数据进行正文提取,例如:
>>>>```
>>>>```
"text":
[
"text":
[
...
@@ -397,7 +411,22 @@
...
@@ -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 解析器
>>>#### 1.1.8 Assert 解析器
>>>> Assert 解析器支持的 parsingType 有:hoursLimit,minutesLimit,contains,matches,notEmpty 六种解析类型,通过 Assert 解析器,符合条件的数据最终会被保留,这里请注意与 AssertFilter 相反
>>>> Assert 解析器支持的 parsingType 有:hoursLimit,minutesLimit,contains,matches,notEmpty 六种解析类型,通过 Assert 解析器,符合条件的数据最终会被保留,这里请注意与 AssertFilter 相反
>>>>##### hoursLimit、minutesLimit:针对时间进行小时级、分钟级限制,例:
>>>>##### hoursLimit、minutesLimit:针对时间进行小时级、分钟级限制,例:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment