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
88b59f64
Commit
88b59f64
authored
Jul 17, 2020
by
马黎滨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
百度采集热搜指数
parent
806be52f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletions
+4
-1
src/main/java/com/zhiwei/searchhotcrawler/crawler/BaiDuHotSearchCrawler.java
+3
-0
src/main/java/com/zhiwei/searchhotcrawler/crawler/ZhihuTopicSearchCrawler.java
+1
-1
No files found.
src/main/java/com/zhiwei/searchhotcrawler/crawler/BaiDuHotSearchCrawler.java
View file @
88b59f64
...
...
@@ -91,6 +91,9 @@ public class BaiDuHotSearchCrawler {
}
else
if
(!
element
.
select
(
"td.last"
).
select
(
"span.icon-rise"
).
isEmpty
())
{
hot
=
element
.
select
(
"td.last"
).
select
(
"span.icon-rise"
).
text
();
}
else
if
(!
element
.
select
(
"td.last"
).
select
(
"span.icon-fair"
).
isEmpty
())
{
hot
=
element
.
select
(
"td.last"
).
select
(
"span.icon-fair"
).
text
();
}
int
count
=
0
;
// 判断hot是否为空
if
(
StringUtils
.
isNotBlank
(
hot
))
{
...
...
src/main/java/com/zhiwei/searchhotcrawler/crawler/ZhihuTopicSearchCrawler.java
View file @
88b59f64
...
...
@@ -36,7 +36,7 @@ public class ZhihuTopicSearchCrawler {
// ZhiWeiTools.sleep(10000L);
String
htmlBody
=
httpBoot
.
syncCall
(
RequestUtils
.
wrapGet
(
url
),
ProxyHolder
.
NAT_HEAVY_PROXY
).
body
().
string
();
log
.
info
(
"页面内容获取:{}"
,
htmlBody
);
//
log.info("页面内容获取:{}",htmlBody);
Document
document
=
Jsoup
.
parse
(
htmlBody
);
String
html
=
document
.
getElementsByTag
(
"script"
).
select
(
"#js-initialData"
).
html
();
jsonObject
=
JSONObject
.
parseObject
(
html
);
...
...
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