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
1538ad5f
Commit
1538ad5f
authored
Aug 30, 2023
by
jimmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交boss数据
parent
3e7836fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
4 deletions
+6
-4
crawler.cpython-311.pyc
__pycache__/crawler.cpython-311.pyc
+0
-0
crawler_baidu.cpython-311.pyc
__pycache__/crawler_baidu.cpython-311.pyc
+0
-0
crawler_boss.cpython-311.pyc
__pycache__/crawler_boss.cpython-311.pyc
+0
-0
crawler.py
crawler.py
+1
-0
crawler_baidu.py
crawler_baidu.py
+3
-2
crawler_boss.py
crawler_boss.py
+2
-2
No files found.
__pycache__/crawler.cpython-311.pyc
View file @
1538ad5f
No preview for this file type
__pycache__/crawler_baidu.cpython-311.pyc
View file @
1538ad5f
No preview for this file type
__pycache__/crawler_boss.cpython-311.pyc
View file @
1538ad5f
No preview for this file type
crawler.py
View file @
1538ad5f
...
...
@@ -14,6 +14,7 @@ def GetCompany(types):
if
response
.
status_code
==
200
:
response_data
=
response
.
json
()
# if response_data.get('name') is not None:
return
"上海临方股权投资管理有限公司"
,
"https://www.zhipin.com/web/geek/job?query=
%
E5
%
A4
%
A7
%
E6
%97%8
F
%
E6
%
BF
%80%
E5
%85%89
&city=100010000"
return
response_data
[
"data"
][
"company_name"
],
response_data
[
"data"
][
"url"
]
return
""
,
""
...
...
crawler_baidu.py
View file @
1538ad5f
...
...
@@ -21,9 +21,10 @@ def GetBaiduCompany(playwright: Playwright) -> int:
page
.
goto
(
url
)
all
=
page
.
locator
(
".lemma-summary"
)
.
all_text_contents
()
intro
=
re
.
sub
(
r'\[[\d-]+\]'
,
''
,
str
(
all
))
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro
)
intro_new
=
intro
[
2
:
len
(
intro
)
-
2
]
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro_new
)
if
name
!=
""
and
intro
!=
'[]'
:
name2
=
crawler
.
SaveCompanyData
(
name
,
1
,
intro
)
name2
=
crawler
.
SaveCompanyData
(
name
,
1
,
intro
_new
)
if
name2
!=
""
:
crawler
.
Log
(
name2
+
":百度数据,写入成功"
)
return
100
...
...
crawler_boss.py
View file @
1538ad5f
...
...
@@ -27,9 +27,9 @@ def spider_company(page):
if
company_nameO
in
company_name
:
my_obj
[
'intro'
]
=
company_intro
crawler
.
Log
(
company_name
+
"-获取到boss数据:"
+
company_intro
)
name2
=
crawler
.
SaveCompanyData
(
company_nameO
,
1
,
company_intro
)
crawler
.
Log
(
company_name
+
"-获取到boss数据:"
+
str
(
company_intro
))
name2
=
crawler
.
SaveCompanyData
(
company_nameO
,
2
,
str
(
company_intro
))
if
name2
!=
""
:
crawler
.
Log
(
name2
+
":boss数据,写入成功"
)
else
:
...
...
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