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
d6ea9dcb
Commit
d6ea9dcb
authored
Dec 19, 2023
by
Charles刘佳佳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed:百科元素class名称改动拉取异常修复
parent
705c1d32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
crawler_baidu.py
crawler_baidu.py
+1
-1
No files found.
crawler_baidu.py
View file @
d6ea9dcb
...
@@ -24,7 +24,7 @@ def GetBaiduCompany(playwright: Playwright) -> int:
...
@@ -24,7 +24,7 @@ def GetBaiduCompany(playwright: Playwright) -> int:
crawler
.
Log
(
name
+
"-百度开始请求数据:"
+
url
)
crawler
.
Log
(
name
+
"-百度开始请求数据:"
+
url
)
page
.
goto
(
url
)
page
.
goto
(
url
)
all_summary
=
page
.
locator
(
".lemma-summary"
)
.
all_text_contents
()
all_summary
=
page
.
locator
(
'div[class^="lemmaSummary"]'
)
.
all_text_contents
()
intro
=
re
.
sub
(
r'\[[\d-]+\]'
,
''
,
str
(
all_summary
))
intro
=
re
.
sub
(
r'\[[\d-]+\]'
,
''
,
str
(
all_summary
))
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro
)
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro
)
try
:
try
:
...
...
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