Commit b52bc71b authored by liyang's avatar liyang

feat:debug

parent 07abae43
......@@ -249,6 +249,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("戴資穎"))
......
......@@ -247,6 +247,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("新闻"))
......
......@@ -235,6 +235,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("新闻"))
......
......@@ -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")
# 删除目录
......
......@@ -322,6 +322,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("新闻"))
......
......@@ -281,6 +281,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("新闻"))
......
......@@ -176,6 +176,11 @@ def main():
else:
log.debug("爬取任务未启用")
else:
global task
task = {
# 爬取时间
"reptileTime": "",
}
log.debug("call failed")
# 请求超时
reptile(None, convert_to_traditional("新闻"))
......
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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment