import requests
#伪造请求:
h = {
"user-agent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
}
response = requests.get(url="https://www.zhihu.com/question/362788804",headers = h)
print(response)
结果:<Response [200]>