python中使用requests 模拟浏览器发送请求数据

import requests

url='http://####'
proxy={'http':'http://####:80'}
headers={
    "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Connection":"keep-alive",
    "Host":    "36kr.com/newsflashes",
    "Upgrade-Insecure-Requests":"1",
    "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:55.0) Gecko/20100101 Firefox/55.0"
}
respone=requests.get(url,timeout=10,headers=headers,proxies=proxy)
print(respone.status_code)
不扯淡,直接上代码!
阅读更多 登录后自动展开
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页