import requests
import json
url = "https://www.douyin.com/aweme/v1/web/comment/list/?device_platform=webapp&aid=6383&channel=channel_pc_web&aweme_id=7208081644471848247&cursor=20&count=5&item_type=0&rcFT=&pc_client_type=1&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=1280&screen_height=720&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=110.0.1587.69&browser_online=true&engine_name=Blink&engine_version=110.0.0.0&os_name=Windows&os_version=10&cpu_core_num=8&device_memory=8&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7209199745494419004&msToken=c06obL4RfLxVcgMOnHvmp0Rw6n1cWsV9uKVnX6ijf83fG0NgI91bDILO9kI2-9BmAPIGbGJW4UA6eJqxzzL8ZvFBwvZr4011Ggg30R--ciAVZNyr4VFHPB4rgtYsbzk=&X-Bogus=DFSzswVYgPkANjcZtabV85ppgizs"
headers = {
"cookie": "ttwid=1%7CtQOY_fSHcVQDKOaa2KbEkI54YX5J2FIl3uD0WP43HwQ%7C1678522627%7C89a8159c9b33883bec31d2698b043885ebb92a6847ffbc1e6641d88ddfd76c96; passport_csrf_token=8984298cf046e8a1aa68b1c008bf0ad5; passport_csrf_token_default=8984298cf046e8a1aa68b1c008bf0ad5; s_v_web_id=verify_lf3p19eu_uKpB5w57_4bx2_4wL1_AabG_zWnQbOOTSN7t; ttcid=f2f68d62d292426ba48f1fd1de97261d12; download_guide=%223%2F20230311%22; SEARCH_RESULT_LIST_TYPE=%22single%22; xgplayer_user_id=800699363207; odin_tt=121745c4c942255d077d1428e6a8f1b2528f40255e928186ddac2b77fe32636f41dae3dcfffe5f64445924d7cf2509a07ededd3800a0ca609d2db8c33a9d0660619cb54548a8a5819dab9feb80726e05; live_can_add_dy_2_desktop=%221%22; strategyABtestKey=%221678588087.704%22; __ac_nonce=0640dba2900be1c6ef070; __ac_signature=_02B4Z6wo00f01hicEkAAAIDD7eP43Fltd8IYvBbAAOI4h7EQbUQDUMerUOS0kKyzoo9agB-K.ravDoo-0H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add_dy_2_desktop=%220%22; msToken=c06obL4RfLxVcgMOnHvmp0Rw6n1cWsV9uKVnX6ijf83fG0NgI91bDILO9kI2-9BmAPIGbGJW4UA6eJqxzzL8ZvFBwvZr4011Ggg30R--ciAVZNyr4VFHPB4rgtYsbzk=",
"referer": "https://www.douyin.com/video/7208081644471848247",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 Edg/110.0.1587.69",
}
response = requests.get(url, headers=headers)
result_list = json.loads(response.text)
result = result_list["comments"]
for i in result:
print(i["text"])
标签:version,22,name,爬取,110.0,抖音,评论,result,browser
From: https://www.cnblogs.com/tiansz/p/17209151.html