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
c5426fd1
Commit
c5426fd1
authored
Aug 31, 2023
by
jimmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交boss
parent
31996e88
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
1 deletion
+3
-1
crawler.py
crawler.py
+1
-1
crawler_baidu.py
crawler_baidu.py
+1
-0
crawler_boss.py
crawler_boss.py
+1
-0
No files found.
crawler.py
View file @
c5426fd1
...
...
@@ -31,7 +31,7 @@ def SaveCompanyData(name,types,intro):
}
json_data
=
json
.
dumps
(
post_data
)
response
=
requests
.
post
(
cyaml
.
data
[
cyaml
.
data
[
"env"
]][
"url"
]
+
cyaml
.
data
[
"php-api"
][
"getcompany"
],
data
=
json_data
,
headers
=
{
"Content-Type"
:
"application/json"
})
# Log("保存数据时候的返回:" + response)
# 检查响应状态码
if
response
.
status_code
==
200
:
response_data
=
response
.
json
()
...
...
crawler_baidu.py
View file @
c5426fd1
...
...
@@ -17,6 +17,7 @@ def GetBaiduCompany(playwright: Playwright) -> int:
page
=
context
.
new_page
()
#获取需要爬取数据的公司
name
,
url
=
crawler
.
GetCompany
(
1
)
crawler
.
Log
(
name
+
"-百度开始请求数据:"
+
url
)
if
url
!=
""
:
page
.
goto
(
url
)
all
=
page
.
locator
(
".lemma-summary"
)
.
all_text_contents
()
...
...
crawler_boss.py
View file @
c5426fd1
...
...
@@ -6,6 +6,7 @@ import cyaml
def
spider_company
(
page
):
company_nameO
,
url
=
crawler
.
GetCompany
(
2
)
crawler
.
Log
(
company_nameO
+
"-boss开始请求数据:"
+
url
)
if
url
!=
""
:
page
.
goto
(
url
)
page
.
wait_for_timeout
(
3000
)
...
...
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