Determine whether the url jump occurred

= URL "https://www.baidu.com/" 
URL = 'HTTP: //www.freebuf.com/fevents/133225.html' 
# Method a: prohibit Jump: = False allow_redirects 
# retransmission request, responsive to give 
= requests.get Response (URL, headers = headers, allow_redirects = False) 
# return a status code 
Print (response.status_code) 

# method two: before and after comparison URL 
Print (URL) 
Print (response.url)

  

Guess you like

Origin www.cnblogs.com/andy9468/p/11495991.html