Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spider
Project
Project
Details
Activity
Releases
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
viitto
spider
Commits
97018653
Commit
97018653
authored
Jul 22, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
447290d8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
210 additions
and
206 deletions
+210
-206
SouthEastDetailsSpider.cs
...der.Spiders/Rules/SouthSastRule/SouthEastDetailsSpider.cs
+178
-205
SouthEastListSpider.cs
...Spider.Spiders/Rules/SouthSastRule/SouthEastListSpider.cs
+18
-0
SouthEastService.cs
...netSpider.Spiders/Rules/SouthSastRule/SouthEastService.cs
+14
-1
No files found.
src/DotnetSpider.Spiders/Rules/SouthSastRule/SouthEastDetailsSpider.cs
View file @
97018653
This diff is collapsed.
Click to expand it.
src/DotnetSpider.Spiders/Rules/SouthSastRule/SouthEastListSpider.cs
View file @
97018653
...
...
@@ -25,6 +25,10 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
public
class
SouthEastListSpider
:
Spider
{
public
int
pageNo
=
1
;
/// <summary>
/// 配置请求
/// </summary>
/// <returns></returns>
public
static
async
Task
RunAsync
()
{
var
builder
=
Builder
.
CreateDefaultBuilder
<
SouthEastListSpider
>(
options
=>
...
...
@@ -43,6 +47,11 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
}
/// <summary>
/// 获取列表数据
/// </summary>
/// <param name="stoppingToken"></param>
/// <returns></returns>
protected
override
async
Task
InitializeAsync
(
CancellationToken
stoppingToken
)
{
AddDataFlow
(
new
ListParser
());
...
...
@@ -84,6 +93,9 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
await
AddRequestsAsync
(
requests
);
}
/// <summary>
/// 东南旅游数据解析
/// </summary>
protected
class
ListParser
:
DataParser
{
public
ListParser
()
...
...
@@ -91,9 +103,15 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
}
/// <summary>
/// 数据解析
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
protected
override
Task
Parse
(
DataContext
context
)
{
var
rootValue
=
JObject
.
Parse
(
context
.
Selectable
.
Value
);
Console
.
WriteLine
(
"SouthEastListSpider:"
+
rootValue
);
if
(
rootValue
!=
null
)
{
var
rootData
=
JObject
.
Parse
(
rootValue
[
"data"
].
ToString
());
...
...
src/DotnetSpider.Spiders/Rules/SouthSastRule/SouthEastService.cs
View file @
97018653
...
...
@@ -22,11 +22,24 @@ namespace DotnetSpider.Spiders.Rules.SouthSastRule
public
async
Task
RunAsync
()
{
Console
.
WriteLine
(
"********* SouthEastService_Srart ***********"
);
//1、获取列表页数量
//await SouthEastListSpider.RunAsync();
Console
.
WriteLine
(
"********* 2222222222222222222222 ***********"
);
//2、获取详情信息,补充列表不完善信息
var
obj
=
new
{
code
=
"GFG0000000094"
,
no
=
"1"
,
travel_title_key
=
"0"
};
TRAVEL_CONFIGS
.
Add
(
new
RB_Travel_Config
()
{
KeyInfo
=
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
obj
)
});
await
SouthEastDetailsSpider
.
RunAsync
();
Console
.
WriteLine
(
"********* SouthEastService_End ************"
);
////3、补充酒店,餐食等信息
//await BwtOtherDetailSpider.RunAsync();
...
...
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