CloudFlare Scrape не получает все файлы cookie - PullRequest
0 голосов
/ 20 октября 2018

Я пытаюсь выполнить запрос POST на веб-сайте, защищенном cloudflare.Для выполнения запросов POST на этом веб-сайте мне нужны файлы cookie, но с помощью cfscrape я могу получить только 2 из 3 необходимых файлов cookie (отсутствует файл _hs_session_v3).Вот мой код:

import cfscrape
scrape = cfscrape.create_scraper()
payload = {"variant_id": "107917", "quantity": "1"}
tokens, user_agent=scrape.get_tokens("https://www.off---white.com/en/IT/women/products/owea143e18a640731001")
headers={
    "authority":"www.off---white.com",
    "accept":"application/json, text/javascript, */*; q=0.01",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "en-US,en;q=0.9",
    "content-length": "35",
    "content-type": "application/json; charset=UTF-8",
    "refer": "https://www.off---white.com/en/IT/women/products/owea143e18a640731001",
    "origin":"https://www.off---white.com",
    "user-agent": user_agent,
    "x-requested-with": "XMLHttpRequest"
        }
res = scrape.post("https://www.off---white.com/en/IT/orders/populate.json",headers=headers,data=payload,cookies=tokens)
print(res.status_code) #=403forbidden because invalid request
...