爬虫之参数合集 headers
UA伪装 <---------->UA检测:门户网站会检测对应请求的载体身份标识,如果是浏览器那就认为是正常用户
headers
headers = { 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Referer': 'http://www.baidu.com/', 'Connection': 'keep-alive', "Content-type": "application/json" }
-----------------------------------------------------------------------------------------------------------------------------------------