欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

在python中使用requests 模擬瀏覽器發(fā)送請(qǐng)求數(shù)據(jù)的方法

 更新時(shí)間:2018年12月26日 10:22:41   作者:hotProgramming  
今天小編就為大家分享一篇在python中使用requests 模擬瀏覽器發(fā)送請(qǐng)求數(shù)據(jù)的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

如下所示:

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)

以上這篇在python中使用requests 模擬瀏覽器發(fā)送請(qǐng)求數(shù)據(jù)的方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論