更新 python/抖音热搜.py

This commit is contained in:
elmgates
2024-09-09 11:16:55 +08:00
parent 44af1fae79
commit 2503efabfb

View File

@@ -8,7 +8,7 @@ browse_header = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36",
"Host": "www.douyin.com", "Host": "www.douyin.com",
"Referer": "https://www.douyin.com/discover", "Referer": "https://www.douyin.com/discover",
"Cookie": "_xsrf=Pd0NpG6J8kZdHtzBVnNyQP1g0rO7NKeg; _zap=d7f27b9f-4fe3-4ef4-9376-df278af16940;" "Cookie": "_xsrf=换你自己的; _zap=换你自己的;"
} }
url = "https://www.douyin.com/aweme/v1/web/hot/search/list/?device_platform=webapp&aid=6383&channel=channel_pc_web" url = "https://www.douyin.com/aweme/v1/web/hot/search/list/?device_platform=webapp&aid=6383&channel=channel_pc_web"
@@ -40,5 +40,5 @@ df = pd.DataFrame({
print(datetime.datetime.now()) print(datetime.datetime.now())
current_datetime = datetime.datetime.now() current_datetime = datetime.datetime.now()
xdate=current_datetime.strftime("%Y-%m-%d-%H-%M-%S") 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) # 保存结果数据