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
fa09f776
Commit
fa09f776
authored
Jul 20, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
b852488d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
crawler_xinyang_ask_service_city.py
dev/xinyang_ask_tag/crawler_xinyang_ask_service_city.py
+2
-3
No files found.
dev/xinyang_ask_tag/crawler_xinyang_ask_service_city.py
View file @
fa09f776
...
@@ -95,7 +95,7 @@ class CrawlerMain(object):
...
@@ -95,7 +95,7 @@ class CrawlerMain(object):
page_obj
=
etree
.
HTML
(
requests_res
.
text
)
page_obj
=
etree
.
HTML
(
requests_res
.
text
)
return
page_obj
,
url
return
page_obj
,
url
else
:
else
:
return
None
,
None
return
None
,
None
except
ReadTimeout
:
except
ReadTimeout
:
print
(
'timeout'
)
print
(
'timeout'
)
return
None
,
None
return
None
,
None
...
@@ -319,7 +319,6 @@ class SoYongSpider(object):
...
@@ -319,7 +319,6 @@ 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
...
@@ -328,7 +327,7 @@ class SoYongSpider(object):
...
@@ -328,7 +327,7 @@ class SoYongSpider(object):
get_data_file
.
close
()
get_data_file
.
close
()
print
(
"get_lasted_data:"
,
get_lasted_data
)
print
(
"get_lasted_data:"
,
get_lasted_data
)
if
len
(
get_lasted_data
)
==
3
:
if
len
(
get_lasted_data
)
==
2
:
return
True
return
True
else
:
else
:
return
False
return
False
...
...
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