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
46d59467
Commit
46d59467
authored
Aug 30, 2023
by
jimmy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
85e1821f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
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_baidu.py
crawler_baidu.py
+7
-3
No files found.
__pycache__/crawler.cpython-311.pyc
View file @
46d59467
No preview for this file type
__pycache__/crawler_baidu.cpython-311.pyc
View file @
46d59467
No preview for this file type
__pycache__/crawler_boss.cpython-311.pyc
View file @
46d59467
No preview for this file type
crawler_baidu.py
View file @
46d59467
...
...
@@ -21,10 +21,14 @@ def GetBaiduCompany(playwright: Playwright) -> int:
page
.
goto
(
url
)
all
=
page
.
locator
(
".lemma-summary"
)
.
all_text_contents
()
intro
=
re
.
sub
(
r'\[[\d-]+\]'
,
''
,
str
(
all
))
intro_new
=
intro
[
2
:
len
(
intro
)
-
2
]
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro_new
)
intro_new
=
str
(
intro
[
2
:
len
(
intro
)
-
2
])
new_string1
=
re
.
sub
(
r'\\n'
,
""
,
intro_new
)
new_string2
=
re
.
sub
(
r'\\xa0'
,
""
,
new_string1
)
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
new_string2
)
if
name
!=
""
and
intro
!=
'[]'
:
name2
=
crawler
.
SaveCompanyData
(
name
,
1
,
intro_new
)
name2
=
crawler
.
SaveCompanyData
(
name
,
1
,
new_string2
)
if
name2
!=
""
:
crawler
.
Log
(
name2
+
":百度数据,写入成功"
)
return
100
...
...
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