requests请求返回的数据为空,相应状态码418怎么解决

import requests
from fake_useragent import UserAgent
from lxml import etree
ua = UserAgent()
print(ua.chrome)
url = "https://movie.douban.com/subject/26266893/reviews?start=120"
headers = {'User-Agent': ua.chrome}
r = requests.get(url,headers)
print(r)

运行结果

解决方法

r = requests.get(url,headers=header)

你可能感兴趣的:(requests请求返回的数据为空,相应状态码418怎么解决)