当对groupon.com的请求时,Python请求返回403

时间:2018-05-18 05:19:19

标签: python python-requests

我正在使用登录groupon.com的请求。但是,此链接返回403: autoload 这是我的代码:

a = requests.get('https://groupon.com')
headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Firefox/60.0",
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    "Accept-Language": "en-US,en;q=0.5",
    "Accept-Encoding": "gzip, deflate",
    "DNT": "1",
    "Connection": "keep-alive",
    "Upgrade-Insecure-Requests": "1",
    "Cookie": a.headers["Set-Cookie"],
    "Referer": "https://www.groupon.com/"
    }
requests.get(url, headers=headers)

0 个答案:

没有答案