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
835fc16a
Commit
835fc16a
authored
Aug 01, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.编写自由时报爬虫脚本
2.编写数据量统计脚本
parent
48c53bef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
pc_ltn.py
pc_ltn.py
+6
-2
index.py
utils/index.py
+2
-2
No files found.
pc_ltn.py
View file @
835fc16a
...
...
@@ -57,7 +57,7 @@ def reptile(browser=None, search_word=""):
# 循环分页
for
key
,
element
in
enumerate
(
page_list_element
):
if
key
>
0
or
key
<=
len
(
page_list_element
)
-
1
:
if
key
>
0
and
key
<=
len
(
page_list_element
)
-
1
:
# 点击分页
browser
.
get
(
f
"{url}&page={key+1}"
)
# element.click()
...
...
@@ -90,7 +90,11 @@ def reptile(browser=None, search_word=""):
# 访问地址
access_address
=
f
'{get_base_file_url()}{table_name.split("_")[1]}/{local_path_name}/{id}.jpg'
# 下载状态
status
=
download_image
(
element
[
'src'
],
download_dir
)
if
"default"
in
element
[
'src'
]:
status
=
False
else
:
status
=
download_image
(
element
[
'src'
],
download_dir
)
if
status
:
# element['src'] = access_address
img_tag
[
"src"
]
=
access_address
...
...
utils/index.py
View file @
835fc16a
...
...
@@ -137,8 +137,8 @@ def parse_ltn_time_string(time_str):
except
ValueError
:
return
None
else
:
# print(time_str
)
return
d
atetime
.
datetime
.
strptime
(
time_str
,
'
%
Y/
%
m/
%
d'
)
dt_object
=
datetime
.
datetime
.
strptime
(
time_str
,
'
%
Y/
%
m/
%
d'
)
return
d
t_object
.
timestamp
(
)
# 转换 youtube 的时间
...
...
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