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
44f58805
Commit
44f58805
authored
Dec 19, 2023
by
jimmy蒋政彪
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-charles-private' into 'master'
fixed:百科元素class名称改动拉取异常修复 See merge request
!3
parents
aa3783b6
7dd787f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
crawler.py
crawler.py
+2
-1
crawler_baidu.py
crawler_baidu.py
+1
-1
No files found.
crawler.py
View file @
44f58805
...
...
@@ -32,7 +32,8 @@ def GetCompany(types):
# 重新放入采集队列
def
DoSpiderCompany
(
company
,
crawler_website
):
post_data
=
{
"company_name"
:
company
"company_name"
:
company
,
"crawler_website"
:
crawler_website
}
json_data
=
json
.
dumps
(
post_data
)
response
=
requests
.
post
(
cyaml
.
data
[
cyaml
.
data
[
"env"
]][
"url"
]
+
cyaml
.
data
[
"php-api"
][
"respidercompany"
],
...
...
crawler_baidu.py
View file @
44f58805
...
...
@@ -24,7 +24,7 @@ def GetBaiduCompany(playwright: Playwright) -> int:
crawler
.
Log
(
name
+
"-百度开始请求数据:"
+
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
))
crawler
.
Log
(
name
+
"-获取到百度数据:"
+
intro
)
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