新闻标题 将空格替换为_ 这样子方便微信中直接点击搜索
This commit is contained in:
@@ -101,7 +101,7 @@ class News(object):
|
||||
str = post['data']['cards'][0]['content']
|
||||
# 遍历列表,并格式化每个字典的title, url,然后添加到output字符串中
|
||||
for index, article in enumerate(str, start=1):
|
||||
title = article['word']
|
||||
title = article['word'].replace(" ", "_")
|
||||
# url = article['url']
|
||||
# 使用f-string格式化字符串,并添加到output中
|
||||
output += f"{index} :#{title}\n"
|
||||
|
||||
Reference in New Issue
Block a user