I want to access the content of a web page, but I'm being redirected to another page even though I've set allow_redirects to False in my requests call. Here's an example code snippet:
import requests
from bs4 import BeautifulSoup
headers = {'User-Agent': user_agent} # assume I inserted my user agent here
URL = "https://stackoverflow.com/questions/73909641/program-is-about-space-utilisation-i-am-getting-error-72g-value-too-great-for"
html_content = requests.get(URL, allow_redirects=False, headers = headers)
soup = BeautifulSoup(html_content.content, "html.parser")
When I run this code, I don't get any content from the web page. However, if I set allow_redirects to True, I'm redirected to this URL: Convert between byte count and "human-readable" string.