Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
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
liyang
network-assets-reptile
Commits
de29ef15
Commit
de29ef15
authored
Jul 27, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:ptt debug
parent
d7796167
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
pc_ptt.py
pc_ptt.py
+4
-3
No files found.
pc_ptt.py
View file @
de29ef15
...
...
@@ -39,9 +39,9 @@ def reptile(browser=None, search_word=""):
# 打开网页
browser
.
get
(
url
)
# log.debug("已打开浏览器")
item_list
=
browser
.
find_elements
(
'xpath'
,
"//div[@class='board-class']"
)
classify_
item_list
=
browser
.
find_elements
(
'xpath'
,
"//div[@class='board-class']"
)
# log.debug(classify_item_list)
classify_item_list
=
item_list
.
copy
()
#
classify_item_list = item_list.copy()
length
=
len
(
classify_item_list
)
for
index
in
range
(
length
):
# 暂时先爬取 第2个 分类
...
...
@@ -203,6 +203,7 @@ def reptile(browser=None, search_word=""):
a
=
3
# 浏览器返回上一页
browser
.
back
()
time
.
sleep
(
0.1
)
element_list
=
browser
.
find_elements
(
'xpath'
,
"//div[@class='r-ent']//div[@class='title']//a"
)
# 浏览器返回上一页
browser
.
back
()
...
...
@@ -210,7 +211,7 @@ def reptile(browser=None, search_word=""):
browser
.
back
()
time
.
sleep
(
0.1
)
# 重新获取
#
classify_item_list = browser.find_elements('xpath', "//div[@class='board-class']")
classify_item_list
=
browser
.
find_elements
(
'xpath'
,
"//div[@class='board-class']"
)
# 发送爬取数据到java服务
# print('----------------------')
...
...
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