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
98db12f4
Commit
98db12f4
authored
Jul 10, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:解决不同操作系统路径分隔符不一致问题
parent
5e50e670
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
6 deletions
+114
-6
app.log
app.log
+108
-0
pc_ptt.py
pc_ptt.py
+5
-5
Logger.py
utils/Logger.py
+1
-1
No files found.
app.log
View file @
98db12f4
...
@@ -174,3 +174,111 @@
...
@@ -174,3 +174,111 @@
2023-07-10 18:51:32,344 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 18:51:32,344 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 18:51:33,608 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1634212242.A.283.html
2023-07-10 18:51:33,608 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1634212242.A.283.html
2023-07-10 18:51:34,715 DEBUG pc_ptt.py : reptile [line: 157] 文件保存成功
2023-07-10 18:51:34,715 DEBUG pc_ptt.py : reptile [line: 157] 文件保存成功
2023-07-10 20:02:29,648 DEBUG pc_ptt.py : main [line: 191] 调用成功
2023-07-10 20:02:35,299 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985401.A.746.html
2023-07-10 20:02:35,393 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:36,651 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985588.A.3E1.html
2023-07-10 20:02:36,793 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:38,065 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985742.A.9F7.html
2023-07-10 20:02:38,409 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:41,324 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985757.A.1A0.html
2023-07-10 20:02:41,422 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:43,358 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986363.A.26C.html
2023-07-10 20:02:43,397 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:44,974 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986405.A.AE8.html
2023-07-10 20:02:45,043 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:46,310 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688987475.A.287.html
2023-07-10 20:02:46,477 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:47,731 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988086.A.71A.html
2023-07-10 20:02:47,945 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:49,181 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988399.A.239.html
2023-07-10 20:02:49,267 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:50,526 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989302.A.DC2.html
2023-07-10 20:02:50,571 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:51,801 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989333.A.D7E.html
2023-07-10 20:02:51,864 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:53,120 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989708.A.366.html
2023-07-10 20:02:53,191 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:54,424 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989758.A.6EE.html
2023-07-10 20:02:54,484 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:55,704 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990129.A.D9F.html
2023-07-10 20:02:55,752 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:56,991 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990257.A.C10.html
2023-07-10 20:02:57,027 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:02:58,298 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1634212242.A.283.html
2023-07-10 20:02:59,443 DEBUG pc_ptt.py : reptile [line: 153] /Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile
2023-07-10 20:02:59,444 DEBUG filse.py : save_json [line: 8] ------save json start--------
2023-07-10 20:02:59,444 DEBUG filse.py : save_json [line: 14] 文件保存路径:/Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile/reptile_data/ptt/1688990579/.json
2023-07-10 20:02:59,445 DEBUG pc_ptt.py : reptile [line: 157] -----------------------------
2023-07-10 20:02:59,446 DEBUG pc_ptt.py : reptile [line: 169] 文件保存失败
2023-07-10 20:03:50,363 DEBUG pc_ptt.py : main [line: 191] 调用成功
2023-07-10 20:03:56,814 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985401.A.746.html
2023-07-10 20:03:56,921 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:03:58,153 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985588.A.3E1.html
2023-07-10 20:03:58,296 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:03:59,914 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985742.A.9F7.html
2023-07-10 20:04:00,284 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:02,948 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985757.A.1A0.html
2023-07-10 20:04:03,064 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:04,898 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986363.A.26C.html
2023-07-10 20:04:04,935 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:06,196 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986405.A.AE8.html
2023-07-10 20:04:06,262 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:07,485 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688987475.A.287.html
2023-07-10 20:04:07,648 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:08,921 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988086.A.71A.html
2023-07-10 20:04:09,150 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:10,360 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988399.A.239.html
2023-07-10 20:04:10,447 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:11,658 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989302.A.DC2.html
2023-07-10 20:04:11,702 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:12,932 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989333.A.D7E.html
2023-07-10 20:04:12,996 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:14,206 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989708.A.366.html
2023-07-10 20:04:14,275 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:15,468 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989758.A.6EE.html
2023-07-10 20:04:15,528 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:16,746 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990129.A.D9F.html
2023-07-10 20:04:16,793 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:18,013 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990257.A.C10.html
2023-07-10 20:04:18,048 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:04:19,282 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1634212242.A.283.html
2023-07-10 20:04:20,403 DEBUG pc_ptt.py : reptile [line: 153] /Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile
2023-07-10 20:04:20,404 DEBUG filse.py : save_json [line: 8] ------save json start--------
2023-07-10 20:04:20,404 DEBUG filse.py : save_json [line: 14] 文件保存路径:/Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile/reptile_data/ptt/1688990660.json
2023-07-10 20:04:20,404 DEBUG pc_ptt.py : reptile [line: 157] -----------------------------
2023-07-10 20:04:20,405 DEBUG pc_ptt.py : reptile [line: 160] 文件保存成功
2023-07-10 20:04:20,405 DEBUG pc_ptt.py : reptile [line: 162] 文件绝对路径:/Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile/reptile_data/ptt/1688990660.json
2023-07-10 20:06:41,079 DEBUG pc_ptt.py : main [line: 191] 调用成功
2023-07-10 20:06:46,744 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985401.A.746.html
2023-07-10 20:06:46,837 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:48,093 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985588.A.3E1.html
2023-07-10 20:06:48,237 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:49,493 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985742.A.9F7.html
2023-07-10 20:06:49,828 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:52,636 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688985757.A.1A0.html
2023-07-10 20:06:54,544 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986363.A.26C.html
2023-07-10 20:06:54,577 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:55,838 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688986405.A.AE8.html
2023-07-10 20:06:55,908 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:57,143 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688987475.A.287.html
2023-07-10 20:06:57,307 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:06:58,532 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988086.A.71A.html
2023-07-10 20:06:59,975 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688988399.A.239.html
2023-07-10 20:07:01,256 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989302.A.DC2.html
2023-07-10 20:07:01,301 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:07:02,510 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989333.A.D7E.html
2023-07-10 20:07:02,566 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:07:03,780 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989708.A.366.html
2023-07-10 20:07:03,849 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:07:05,051 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688989758.A.6EE.html
2023-07-10 20:07:06,597 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990129.A.D9F.html
2023-07-10 20:07:06,646 DEBUG pc_ptt.py : reptile [line: 127] 未找到匹配的字符串
2023-07-10 20:07:08,410 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1688990257.A.C10.html
2023-07-10 20:07:09,672 DEBUG pc_ptt.py : reptile [line: 88] 网页链接https://www.ptt.cc/bbs/Baseball/M.1634212242.A.283.html
2023-07-10 20:07:10,797 DEBUG pc_ptt.py : reptile [line: 153] /Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile
2023-07-10 20:07:10,797 DEBUG filse.py : save_json [line: 8] ------save json start--------
2023-07-10 20:07:10,798 DEBUG filse.py : save_json [line: 14] 文件保存路径:/Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile/reptile_data/ptt/1688990830.json
2023-07-10 20:07:10,800 DEBUG pc_ptt.py : reptile [line: 157] -----------------------------
2023-07-10 20:07:10,800 DEBUG pc_ptt.py : reptile [line: 160] 文件保存成功
2023-07-10 20:07:10,801 DEBUG pc_ptt.py : reptile [line: 162] 文件绝对路径:/Users/macosx/Desktop/项目文档/网络资产管理系统/network-assets-reptile/reptile_data/ptt/1688990830.json
pc_ptt.py
View file @
98db12f4
...
@@ -157,16 +157,16 @@ def reptile(browser=None, search_word=""):
...
@@ -157,16 +157,16 @@ def reptile(browser=None, search_word=""):
log
.
debug
(
"-----------------------------"
)
log
.
debug
(
"-----------------------------"
)
# write_to_database(data)
# write_to_database(data)
if
state_save
:
if
state_save
:
log
.
debug
(
'
文件保存成功
'
)
log
.
debug
(
'
save file success
'
)
# path = os.path.abspath(file_dir).join(file_dir).join(".json")
# path = os.path.abspath(file_dir).join(file_dir).join(".json")
log
.
debug
(
'
文件绝对路径
:'
+
file_dir
)
log
.
debug
(
'
file_path
:'
+
file_dir
)
form_data
=
{
form_data
=
{
"path"
:
file_dir
,
"path"
:
file_dir
,
"tableName"
:
table_name
"tableName"
:
table_name
}
}
response
=
importJsonPath
(
form_data
)
response
=
importJsonPath
(
form_data
)
else
:
else
:
log
.
debug
(
'
文件保存失败
'
)
log
.
debug
(
'
save file failed
'
)
# 关闭浏览器驱动
# 关闭浏览器驱动
# time.sleep(3)
# time.sleep(3)
browser
.
quit
()
browser
.
quit
()
...
@@ -188,7 +188,7 @@ def main():
...
@@ -188,7 +188,7 @@ def main():
response
=
getReptileTask
()
response
=
getReptileTask
()
if
response
[
'status_code'
]
==
200
and
response
[
'data'
][
'code'
]
==
200
:
if
response
[
'status_code'
]
==
200
and
response
[
'data'
][
'code'
]
==
200
:
log
.
debug
(
"
调用成功
"
)
log
.
debug
(
"
call success
"
)
search_word
=
""
search_word
=
""
for
item
in
response
[
'data'
][
'rows'
]:
for
item
in
response
[
'data'
][
'rows'
]:
if
item
[
'name'
]
==
'ptt'
:
if
item
[
'name'
]
==
'ptt'
:
...
@@ -197,7 +197,7 @@ def main():
...
@@ -197,7 +197,7 @@ def main():
# print(convert_to_traditional(search_word))
# print(convert_to_traditional(search_word))
reptile
(
None
,
convert_to_traditional
(
search_word
))
reptile
(
None
,
convert_to_traditional
(
search_word
))
else
:
else
:
log
.
debug
(
"
调用失败
"
)
log
.
debug
(
"
call failed
"
)
# upload_control()
# upload_control()
...
...
utils/Logger.py
View file @
98db12f4
...
@@ -13,7 +13,7 @@ class MyLogger(Logger):
...
@@ -13,7 +13,7 @@ class MyLogger(Logger):
# 获取日志文件路径
# 获取日志文件路径
all_log_path_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
get_log_path
()),
"app.log"
)
all_log_path_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
get_log_path
()),
"app.log"
)
error_log_path_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
get_log_path
()),
"error.log"
)
error_log_path_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
get_log_path
()),
"error.log"
)
# print(all_log_path_file+'-----
')
print
(
f
'log file path:{all_log_path_file}
'
)
# 设置日志的名字、日志的收集级别
# 设置日志的名字、日志的收集级别
super
()
.
__init__
(
"test_api"
,
logging
.
DEBUG
)
super
()
.
__init__
(
"test_api"
,
logging
.
DEBUG
)
...
...
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