Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toutiao
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
zhiwei
toutiao
Commits
7b17220c
Commit
7b17220c
authored
Jul 24, 2018
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改采集包
parent
f6290b0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
pom.xml
+1
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
+13
-7
No files found.
pom.xml
View file @
7b17220c
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<dependency>
<dependency>
<groupId>
com.zhiwei
</groupId>
<groupId>
com.zhiwei
</groupId>
<artifactId>
zhiweiTools
</artifactId>
<artifactId>
zhiweiTools
</artifactId>
<version>
0.0.
6
-SNAPSHOT
</version>
<version>
0.0.
7
-SNAPSHOT
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
View file @
7b17220c
...
@@ -151,15 +151,21 @@ public class TouTiaoArticleParse {
...
@@ -151,15 +151,21 @@ public class TouTiaoArticleParse {
}
}
Map
<
String
,
String
>
headerMap
=
Tools
.
getTouTiaoHeader
();
Map
<
String
,
String
>
headerMap
=
Tools
.
getTouTiaoHeader
();
headerMap
.
put
(
"Referer"
,
"https://www.toutiao.com/c/user/"
+
user_id
+
"/"
);
headerMap
.
put
(
"Referer"
,
"https://www.toutiao.com/c/user/"
+
user_id
+
"/"
);
String
htmlBody
=
HttpClientTemplateOK
.
get
(
url
,
proxy
,
headerMap
);
try
{
if
(
htmlBody
!=
null
)
{
String
htmlBody
=
HttpClientTemplateOK
.
get
(
url
,
proxy
,
headerMap
);
Map
<
String
,
Object
>
dataMap
=
parseHtmlByMicroAccount
(
htmlBody
,
endDate
);
if
(
htmlBody
!=
null
)
{
if
(
dataMap
!=
null
&&
dataMap
.
size
()>
0
){
Map
<
String
,
Object
>
dataMap
=
parseHtmlByMicroAccount
(
htmlBody
,
endDate
);
return
dataMap
;
if
(
dataMap
!=
null
&&
dataMap
.
size
()>
0
){
return
dataMap
;
}
}
else
{
logger
.
info
(
"数据为null"
);
}
}
}
else
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"数据为null"
);
logger
.
info
(
"获取数据出错::{},数据为null"
,
e
.
fillInStackTrace
());
return
null
;
}
}
return
null
;
return
null
;
}
}
...
...
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