我想弄清楚这一点,但没有运气:
import requests r = requests.get('http://example.com/m7ppct4', allow_redirects=True)
r.status_code
返回200
并r.content
返回''
.
r.headers
返回以下字典:
{'content-length': '0', 'content-language': 'en-US', 'x-powered-by': 'Servlet/3.0', 'set-cookie': '__cfduid=d4b3d47d43189ac72be14b1d2a2bed98a1408989649815; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.azdoa.gov; HttpOnly, LWJSESSIONID=0000SESSIONMANAGEMENTAFFINI:18h1v85u3; Path=/; HttpOnly, NSC_batubufkpctWTTTM=ffffffff09f39f1545525d5f4f58455e445a4a42378b;expires=Mon, 25-Aug-2014 18:02:49 GMT;path=/;secure;httponly', 'expires': 'Thu, 01 Dec 1994 16:00:00 GMT', 'server': 'cloudflare-nginx', 'connection': 'keep-alive', 'x-ua-compatible': 'IE=EmulateIE9', 'cache-control': 'no-cache="set-cookie, set-cookie2"', 'date': 'Mon, 25 Aug 2014 18:00:49 GMT', 'cf-ray': '15f9b0ff50cf0d6d-LAX', 'content-type': 'application/octet-stream'}
当我在浏览器中打开页面时,我清楚地得到了内容.
关于如何进行调试的任何想法?我想通过requests.get()
电话获取页面内容.