豆瓣电影喜剧前20
作者:互联网
import requests
import json
url = 'https://movie.douban.com/j/new_search_subjects'
#重新封装
param = {
"sort":"u",
"range":"0,10",
"tags":"电影",
"start":"0",
"genres":"喜剧",
}
headers = {
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36"
}
resp = requests.get(url=url, params=param, headers=headers)
print(resp.json())
结果:
标签:20,headers,url,resp,json,param,喜剧,537.36,豆瓣 来源: https://blog.csdn.net/weixin_45189475/article/details/120452298