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
Jinhao Chen
crawler-template-manual
Commits
b2a6e13e
Commit
b2a6e13e
authored
Apr 18, 2019
by
Jinhao Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
0b97e4d0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
4 deletions
+40
-4
README.md
+40
-4
No files found.
README.md
View file @
b2a6e13e
# 知微数据可视化爬虫
模版编写手册
# 知微数据可视化爬虫
平台
项目主页: http://crawler.zhiweidata.com
项目主页: 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 解析器简介
...
@@ -19,7 +22,7 @@
...
@@ -19,7 +22,7 @@
>>> |command|解析器命令|
>>> |command|解析器命令|
>>> |attrName|解析器附加字段,此字段可缺省,仅在需要的时候使用|
>>> |attrName|解析器附加字段,此字段可缺省,仅在需要的时候使用|
>>>#### 1.1.1 Appender 解析器
>>>#### 1.1.1 Appender 解析器
>>>> Appender 解析器支持的 parsingType 有:overwrite
,prefix,suffix,
同时支持宏命令调用
>>>> Appender 解析器支持的 parsingType 有:overwrite
, default, prefix,suffix
同时支持宏命令调用
>>>>##### overwrite:顾名思义即重写,根据 command 内容进行重写,一般用于新建变量,例:
>>>>##### overwrite:顾名思义即重写,根据 command 内容进行重写,一般用于新建变量,例:
>>>> ```
>>>> ```
"field":
[
"field":
[
...
@@ -31,6 +34,7 @@
...
@@ -31,6 +34,7 @@
]
]
>>>> ```
>>>> ```
>>>> 输出结果: field = hello
>>>> 输出结果: field = hello
>>>>##### default:当传入本解析器的内容为空的时候则会执行此解析器,命令支持宏或者普通字符串
>>>>##### prefix:即在输入数据的左边即开头追加字符串或宏命令
>>>>##### prefix:即在输入数据的左边即开头追加字符串或宏命令
>>>>##### suffix: 即在输入数据的右边即末尾追加字符串或宏命令
>>>>##### suffix: 即在输入数据的右边即末尾追加字符串或宏命令
>>>> ```
>>>> ```
...
@@ -315,7 +319,7 @@
...
@@ -315,7 +319,7 @@
>>>>```
>>>>```
>>>> 上述规则支持解析2015年6月30日或20150630的形式或包含英文日期格式
>>>> 上述规则支持解析2015年6月30日或20150630的形式或包含英文日期格式
>>>#### 1.1.7 Helper 解析器
>>>#### 1.1.7 Helper 解析器
>>>> Helper 解析器支持的 parsingType 有:fixurl,javascript,articleExtract,其中 command 支持所有宏(一般用 $self.url 或 $pre.self.url)与普通字符串
>>>> Helper 解析器支持的 parsingType 有:fixurl,javascript,articleExtract,
urlEncoder, urlDecoder
其中 command 支持所有宏(一般用 $self.url 或 $pre.self.url)与普通字符串
>>>>##### fixurl:根据上次访问的 URL,结合输入(绝对或相对 URL),生成一个新的绝对 URL,例:
>>>>##### fixurl:根据上次访问的 URL,结合输入(绝对或相对 URL),生成一个新的绝对 URL,例:
>>>>```
>>>>```
"url":
[
"url":
[
...
@@ -347,7 +351,7 @@
...
@@ -347,7 +351,7 @@
]
]
>>>>```
>>>>```
>>>> 结果为 test = 122
>>>> 结果为 test = 122
>>>>##### articleExtract:
讲
上文传递过来的数据进行正文提取,例如:
>>>>##### articleExtract:
将
上文传递过来的数据进行正文提取,例如:
>>>>```
>>>>```
"text":
[
"text":
[
{
{
...
@@ -362,6 +366,38 @@
...
@@ -362,6 +366,38 @@
]
]
>>>>```
>>>>```
>>>> 结果为 text = 知微数据
>>>> 结果为 text = 知微数据
>>>>##### urlEncoder:将上文传递过来的数据进行 URL 编码,例如:
>>>>```
"text":
[
{
"parserName": "appender",
"parsingType": "overwrite",
"command": "知微数据"
},
{
"parserName": "helper",
"parsingType": "urlEncoder",
"command": "gb18030"
}
]
>>>>```
>>>> 结果为 text = %d6%aa%ce%a2%ca%fd%be%dd
>>>>##### urlDecoder:将上文传递过来的数据进行 URL 解码,例如:
>>>>```
"text":
[
{
"parserName": "appender",
"parsingType": "overwrite",
"command": "%d6%aa%ce%a2%ca%fd%be%dd"
},
{
"parserName": "helper",
"parsingType": "urlDecoder",
"command": "gb18030"
}
]
>>>>```
>>>> 结果为 text = 知微数据
>>>#### 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