import requests
import json
headers={
"User-Agent": "Mozilla / 5.0(Windows NT 6.1;WOW64) AppleWebKit / 537.36(KHTML, likeGecko) Chrome / 85.0.4183.83Safari / 537.36"
}
url = 'https://movie.douban.com/j/chart/top_list'
param = {
"type": "24",
"interval_id": "100:90",
"action": "",
"start": "20",
"limit": "20",
}
response = requests.get(url=url,params=param,headers=headers)
list_data = response.content.decode()
filename = 'doubin.json'
with open(filename,'w',encoding='utf-8') as fp:
fp.write(filename)
print(filename,'保存成功')
简单爬取豆瓣排行榜,并保存为json格式
最新推荐文章于 2022-01-08 19:00:56 发布