更新 python/百度热搜.py
This commit is contained in:
@@ -8,6 +8,7 @@ browse_header = {
|
||||
}
|
||||
|
||||
url = "https://tenapi.cn/v2/baiduhot"
|
||||
#api即将作废,请寻找其他api或使用另外一个项目
|
||||
|
||||
res = requests.get(url, headers=browse_header).json()
|
||||
# 实时上升热点
|
||||
@@ -30,5 +31,5 @@ df = pd.DataFrame({
|
||||
print(datetime.datetime.now())
|
||||
current_datetime = datetime.datetime.now()
|
||||
xdate=current_datetime.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
df.to_excel(f'../数据汇总/百度/{xdate}百度热搜榜.xlsx', index=False) # 保存结果数据
|
||||
df.to_excel(f'./数据汇总/{xdate}百度热搜榜.xlsx', index=False) # 保存结果数据
|
||||
|
||||
|
||||
Reference in New Issue
Block a user