'Keep getting "494 ERROR" when trying to access website's html rather than what I should be getting on chegg

I wrote this code and used cookies from a previous browser's login of the account on chegg to use in the header for the request, however in the HTML file that is my output, I am getting and ERROR 494, and it says:

<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>494 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Bad request.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: B-X1lKVIR_R5myd55QovaPqWcx_61ys_A_Vd8_t-gNPShg3_2cltRQ==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

when instead I should be getting the HTML to solution on the chegg page. Here is my python code:


url2 = 'https://www.chegg.com/homework-help/questions-and-answers/part-income-inequality-likely-result-discrimination-factors-responsible-inequality-include-q33116985'
with open('cookiesWii.txt', 'r') as file:
    data12 = file.read().replace('\n', '')

headers = {
    'authority': 'www.chegg.com',
    # 'cache-control': 'max-age=0',
    "Accept-Encoding": "gzip, deflate, br",
    'accept-language': 'en-US,en;q=0.9',
    'cookie': data12,
    'sec-ch-ua': '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
    'sec-ch-ua-mobile': '?0',
    'upgrade-insecure-requests': '1',
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'sec-fetch-site': 'cross-site',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-user': '?1',
    'sec-fetch-dest': 'document',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',

}


response = requests.get(url=url2, headers=headers)
htmlData = response.text
fileFinTest = open("sampleTest.html","w")
fileFinTest.write(htmlData)
fileFinTest.close()```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source