Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amazon_reports
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
common
amazon_reports
Commits
028d0f9d
Commit
028d0f9d
authored
Dec 17, 2024
by
邱阿朋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c7f4617e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
return_goods.py
src/return_goods.py
+8
-7
spa_search.py
src/spa_search.py
+11
-3
No files found.
src/return_goods.py
View file @
028d0f9d
# coding: utf-8
# 导出退款记录
import
os
from
datetime
import
datetime
import
pandas
as
pd
from
DrissionPage
import
ChromiumPage
...
...
@@ -33,12 +34,6 @@ def export_list_read_data():
file_name
=
"Return_Summary.xls"
if
not
os
.
path
.
isfile
(
file_name
):
raise
FileNotFoundError
(
f
"{file_name},文件不存在"
)
# 访问网页
# page_get("hz/vendor/members/returns?ref_=vc_xx_subNav")
# # 导出退货单
# page.ele("#file-download-button").click.to_download()
# file.wait_for_downloads(file_name)
return
pd
.
read_excel
(
file_name
,
engine
=
'xlrd'
)
...
...
@@ -100,7 +95,13 @@ def main():
# 追加数据
new_list_data
.
append
(
data_dict
)
excel
.
save_xls
(
new_list_data
,
'退货明细.xlsx'
)
# 获取当前日期和时间并格式化
current_datetime
=
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M'
)
# 格式化为 'YYYY-MM-DD_HH-MM-SS'
# 原文件名
file_name
=
"退货明细.xlsx"
# 拼接新的文件名
new_file_name
=
f
"{current_datetime}_{file_name}"
excel
.
save_xls
(
new_list_data
,
new_file_name
)
if
__name__
==
'__main__'
:
...
...
src/spa_search.py
View file @
028d0f9d
...
...
@@ -3,6 +3,7 @@
import
math
import
os
import
shutil
from
datetime
import
datetime
from
urllib.parse
import
urlparse
,
parse_qs
import
pandas
as
pd
...
...
@@ -109,6 +110,13 @@ def main():
coop_list
=
export_list_read_data
()
# 获取合作数据列表
log
.
info
(
f
"共计:{len(coop_list)} 条数据"
)
# 获取当前日期和时间并格式化
current_datetime
=
datetime
.
now
()
.
strftime
(
'
%
Y
%
m
%
d
%
H
%
M'
)
# 格式化为 'YYYY-MM-DD_HH-MM-SS'
# 原文件名
file_name
=
"spa.xlsx"
# 拼接新的文件名
new_file_name
=
f
"{current_datetime}_{file_name}"
i
=
0
new_coop_data
=
[]
sheet_data
=
{}
...
...
@@ -169,7 +177,7 @@ def main():
# 保存最终的合作数据
if
new_coop_data
:
excel
.
save_xls
(
new_coop_data
,
'SPA查询.xlsx'
)
excel
.
save_xls
(
new_coop_data
,
new_file_name
)
max_sheet_data
=
{}
...
...
@@ -180,11 +188,11 @@ def main():
max_sheet_data
[
key
]
=
value
continue
excel
.
save_xls
(
value
,
'SPA查询.xlsx'
,
key
)
excel
.
save_xls
(
value
,
new_file_name
,
key
)
if
max_sheet_data
:
for
key
,
value
in
max_sheet_data
.
items
():
excel
.
save_xls
(
value
,
'SPA查询.xlsx'
,
key
)
excel
.
save_xls
(
value
,
new_file_name
,
key
)
if
__name__
==
'__main__'
:
...
...
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