Why does SteamGifts return a 403 response when I access SteamGifts in Python code?
Here's the Python code
import httpx
url = "https://www.steamgifts.com/"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8,zh-HK;q=0.7,en-US;q=0.6,en;q=0.5",
"Accept-Encoding": "gzip, deflate, br, zstd",
"DNT": "1",
"Sec-GPC": "1",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Host": "www.steamgifts.com",
"Sec-Fetch-Site": "none",
"Priority": "u=0, i",
"Sec-Fetch-User": "?1",
"TE": "trailers",
}
client = httpx.Client(http2=True, cookies=cookie_io.load())
response = client.get(url, headers=headers)
print(f"Responnse code: {response.status_code}")
I copied request headers and cookies from my Firefox Browser into my Python code, and use HTTP/2.
Why SteamGifts return 403 response?