爬取学习

request学习深入:代码部分:

import requests
url = "https://movie.douban.com/j/chart/top_list"
param = {
"type": "24",
"interval_id": "100:90",
"action": "",
"start": "0",
"limit": "20"
}
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3947.100 Safari/537.36"
}
resp = requests.get(url=url,params=param,headers=headers)
print(resp.json())
resp.close()
原文地址:https://www.cnblogs.com/092e/p/14954992.html