Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
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
backend
crawler
Commits
6394ec7a
Commit
6394ec7a
authored
Jul 20, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
faa5455c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
crawler_xinyang_ask_service_city.py
dev/xinyang_ask_tag/crawler_xinyang_ask_service_city.py
+3
-4
No files found.
dev/xinyang_ask_tag/crawler_xinyang_ask_service_city.py
View file @
6394ec7a
...
@@ -174,7 +174,8 @@ class CrawlerMain(object):
...
@@ -174,7 +174,8 @@ class CrawlerMain(object):
service_info
[
'平台'
]
=
"新氧"
service_info
[
'平台'
]
=
"新氧"
service_info
[
'链接'
]
=
"https://y.soyoung.com/cp{}"
.
format
(
pid
)
service_info
[
'链接'
]
=
"https://y.soyoung.com/cp{}"
.
format
(
pid
)
sort_service_info
=
sorted
(
service_info
.
items
(),
key
=
lambda
x
:
self
.
title
.
index
(
x
[
0
]),
reverse
=
False
)
sort_service_info
=
sorted
(
service_info
.
items
(),
key
=
lambda
x
:
self
.
title
.
index
(
x
[
0
]),
reverse
=
False
)
page_service_pids
.
append
(
dict
(
sort_service_info
))
page_service_pids
.
append
(
dict
(
sort_service_info
))
else
:
else
:
current_end_flat
=
True
current_end_flat
=
True
...
@@ -305,9 +306,6 @@ class SoYongSpider(object):
...
@@ -305,9 +306,6 @@ class SoYongSpider(object):
get_lasted_data
.
append
(
keyword
)
get_lasted_data
.
append
(
keyword
)
for
page
in
range
(
1
,
self
.
page_num
):
# 筛选前100个
for
page
in
range
(
1
,
self
.
page_num
):
# 筛选前100个
if
self
.
page_num
==
page
+
1
and
len
(
get_lasted_data
)
==
2
:
get_lasted_data
.
append
(
page
)
word
=
str
(
keyword
+
city_name
)
word
=
str
(
keyword
+
city_name
)
if
word
not
in
self
.
have_get_service_info
.
keys
()
or
self
.
have_get_service_info
[
word
]
<
10
:
if
word
not
in
self
.
have_get_service_info
.
keys
()
or
self
.
have_get_service_info
[
word
]
<
10
:
print
(
city_name
,
","
,
city_id
,
","
,
keyword
,
","
,
page
)
print
(
city_name
,
","
,
city_id
,
","
,
keyword
,
","
,
page
)
...
@@ -321,6 +319,7 @@ class SoYongSpider(object):
...
@@ -321,6 +319,7 @@ class SoYongSpider(object):
get_data_file
.
write
(
json
.
dumps
(
data
))
get_data_file
.
write
(
json
.
dumps
(
data
))
get_data_file
.
write
(
"
\n
"
)
get_data_file
.
write
(
"
\n
"
)
if
current_end_flat
==
True
:
if
current_end_flat
==
True
:
get_lasted_data
.
append
(
page
)
break
break
else
:
else
:
pass
pass
...
...
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