Get your own Python server Result Size: 625 x 565
x
 
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)
200