Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
demo_requests_head_allow_redirects2.py:
import requests url = 'https://w3schools.com/python/demopage.php' x = requests.head(url, allow_redirects=True) #The server will redirect this url to 'https://w3schools.com/python/demopage.php' #and since the head method by default do not allow redirects, we must use allow_redirects=True. print(x.status_code)
C:\Users\My Name>python demo_requests_head_allow_redirects2.py
200