Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
crawler-py
Project
Project
Details
Activity
Releases
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
jimmy蒋政彪
crawler-py
Commits
05c6cc59
Commit
05c6cc59
authored
Nov 24, 2023
by
Charles刘佳佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed:redis使用测试的redis配置
parent
59f3fcb8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
crawler.py
crawler.py
+16
-0
No files found.
crawler.py
View file @
05c6cc59
...
@@ -31,6 +31,22 @@ def GetCompany(types):
...
@@ -31,6 +31,22 @@ def GetCompany(types):
# 重新放入采集队列
# 重新放入采集队列
def
DoSpiderCompany
(
company
,
crawler_website
):
def
DoSpiderCompany
(
company
,
crawler_website
):
post_data
=
{
"company_name"
:
company
}
json_data
=
json
.
dumps
(
post_data
)
response
=
requests
.
post
(
cyaml
.
data
[
cyaml
.
data
[
"env"
]][
"url"
]
+
cyaml
.
data
[
"php-api"
][
"respidercompany"
],
data
=
json_data
,
headers
=
{
"Content-Type"
:
"application/json"
})
# 检查响应状态码
if
response
.
status_code
==
200
:
return
200
else
:
return
""
# 重新放入采集队列
def
DoSpiderCompany2
(
company
,
crawler_website
):
if
crawler_website
==
"baike"
:
if
crawler_website
==
"baike"
:
redis_key
=
WAIT_SPIDER_BAIKE_COMPANY_LIST
redis_key
=
WAIT_SPIDER_BAIKE_COMPANY_LIST
elif
crawler_website
==
"boss"
:
elif
crawler_website
==
"boss"
:
...
...
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