mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update other_than.py
This commit is contained in:
parent
71f860a500
commit
58957cdf44
@ -39,6 +39,7 @@ async def get_other_data(place: str) -> Optional[str]:
|
|||||||
return None
|
return None
|
||||||
find_data = re.compile(r"varallData=(.*?);</script>")
|
find_data = re.compile(r"varallData=(.*?);</script>")
|
||||||
sum_ = re.findall(find_data, html)[0]
|
sum_ = re.findall(find_data, html)[0]
|
||||||
|
try:
|
||||||
sum_ = json.loads(sum_)
|
sum_ = json.loads(sum_)
|
||||||
other_country = sum_["yiqing_v2"]["dataList"][29]["child"]
|
other_country = sum_["yiqing_v2"]["dataList"][29]["child"]
|
||||||
for country in other_country:
|
for country in other_country:
|
||||||
@ -67,4 +68,6 @@ async def get_other_data(place: str) -> Optional[str]:
|
|||||||
f"死亡:{intcomma(city['siwang'])}\n"
|
f"死亡:{intcomma(city['siwang'])}\n"
|
||||||
"——————————————"
|
"——————————————"
|
||||||
)
|
)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"疫情查询发生错误 {type(e)}:{e}")
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user