Skip to content

Commit

Permalink
添加rss返回内容的编码格式,尝试定位SAXParseException
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesehuazhou committed Jan 14, 2024
1 parent b93a369 commit a40cbee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions resources/weekly_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async def get_last_issue_async(client, name, url):
"""异步获取周刊本周发布的标题和链接"""
try:
response = await client.get(url, timeout=30.0)
response.encoding = 'utf-8'
feed = feedparser.parse(response.text)
except Exception as e:
print(f"Error occurred while processing feed {url}: {type(e).__name__}, {e}")
Expand Down

0 comments on commit a40cbee

Please sign in to comment.