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
b52bc71b
Commit
b52bc71b
authored
Aug 14, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:debug
parent
07abae43
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
47 additions
and
15 deletions
+47
-15
pc_dcard.py
pc_dcard.py
+5
-0
pc_facebook.py
pc_facebook.py
+5
-0
pc_instagram.py
pc_instagram.py
+5
-0
pc_ltn.py
pc_ltn.py
+5
-0
pc_ptt.py
pc_ptt.py
+5
-0
pc_twitter.py
pc_twitter.py
+5
-0
pc_youtube.py
pc_youtube.py
+5
-0
test.py
test.py
+12
-15
No files found.
pc_dcard.py
View file @
b52bc71b
...
...
@@ -249,6 +249,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"戴資穎"
))
...
...
pc_facebook.py
View file @
b52bc71b
...
...
@@ -247,6 +247,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"新闻"
))
...
...
pc_instagram.py
View file @
b52bc71b
...
...
@@ -235,6 +235,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"新闻"
))
...
...
pc_ltn.py
View file @
b52bc71b
...
...
@@ -169,6 +169,11 @@ def reptile(browser=None, search_word=""):
log
.
debug
(
'save file failed'
)
script_close
(
browser
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
# 爬取数据为空
log
.
info
(
"no reptile data"
)
# 删除目录
...
...
pc_ptt.py
View file @
b52bc71b
...
...
@@ -322,6 +322,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"新闻"
))
...
...
pc_twitter.py
View file @
b52bc71b
...
...
@@ -281,6 +281,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"新闻"
))
...
...
pc_youtube.py
View file @
b52bc71b
...
...
@@ -176,6 +176,11 @@ def main():
else
:
log
.
debug
(
"爬取任务未启用"
)
else
:
global
task
task
=
{
# 爬取时间
"reptileTime"
:
""
,
}
log
.
debug
(
"call failed"
)
# 请求超时
reptile
(
None
,
convert_to_traditional
(
"新闻"
))
...
...
test.py
View file @
b52bc71b
import
json
# 读取JSON文件内容
with
open
(
'./staticLogicEdgeInfo.json'
,
'r'
)
as
file
:
json_data
=
file
.
read
()
# 解析JSON内容
parsed_data
=
json
.
loads
(
json_data
)
# 将JSON内容转换为一行
compressed_json
=
json
.
dumps
(
parsed_data
,
separators
=
(
','
,
':'
))
# 将压缩后的内容写入文件
with
open
(
'staticLogicEdgeInfo.json'
,
'w'
)
as
file
:
file
.
write
(
compressed_json
)
\ No newline at end of file
# 给定的字符串数组
input_strings
=
[
'NBA'
,
'疫苗预约'
,
'1922'
,
'水库'
,
'五倍券'
,
'奥运'
,
'锦心似玉'
,
'戴资颖'
,
'停电'
,
"乌克兰"
,
"地震"
,
"疫情"
,
"世足赛"
,
"快筛地图"
,
"安倍晋三"
,
"疫苗预约"
,
"中华职棒"
,
"艾成"
]
# 使用列表推导式将字符串数组转换为字典列表
result
=
[{
'value'
:
'30'
,
'name'
:
item
}
for
item
in
input_strings
]
# 打印转换结果
print
(
result
)
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