Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
searchhotcrawler
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
searchhotcrawler
Commits
0ca8540e
Commit
0ca8540e
authored
Dec 05, 2022
by
chenweitao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'working' into 'master'
增加脉脉话题重试次数 See merge request
!225
parents
96fb7113
2247b2af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/MaiMaiTopicCrawler.java
+11
-0
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/MaiMaiTopicCrawler.java
View file @
0ca8540e
...
...
@@ -29,13 +29,16 @@ public class MaiMaiTopicCrawler {
String
url
=
"https://open.taou.com/maimai/feed/v6/hot_list_entry/feeds?page_version=2&tab_id=topic&version=6.2.34&u=232258287&access_token=1.4c82e8ad6d6b4e03262a48f334dea336"
;
String
htmlBody
=
null
;
Request
request
=
RequestUtils
.
wrapGet
(
url
);
for
(
int
x
=
0
;
x
<=
2
;
x
++)
{
Response
response
=
HttpClientUtils
.
httpBoot
.
syncCall
(
request
,
ProxyServerSupplier
.
NAT_HEAVY_PROXY
);
if
(
response
.
hasCause
()){
Throwable
cause
=
response
.
cause
();
log
.
error
(
"脉脉话题页面连接异常..."
,
cause
);
continue
;
}
else
{
htmlBody
=
response
.
bodyString
();
}
try
{
if
(
StringUtils
.
isNotBlank
(
htmlBody
)
&&
htmlBody
.
contains
(
"topics"
))
{
JSONArray
jsonArray
=
JSONObject
.
parseObject
(
htmlBody
).
getJSONArray
(
"topics"
);
if
(
jsonArray
!=
null
)
{
...
...
@@ -50,6 +53,14 @@ public class MaiMaiTopicCrawler {
list
.
add
(
hotSearchList
);
}
}
}
else
{
continue
;
}
}
catch
(
Exception
e
)
{
log
.
info
(
"脉脉话题解析异常"
,
e
);
continue
;
}
break
;
}
log
.
info
(
"{}, 此轮脉脉话题采集到的数据量为:{}"
,
new
Date
(),
list
!=
null
?
list
.
size
()
:
0
);
log
.
info
(
"脉脉话题采集结束"
);
...
...
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