Posts

Showing posts with the label url-redirection

Is it possible to check if a certain url is redericting without opening a request to the site in Python? [duplicate]

Is it possible to check if a certain url is redericting without opening a request to the site in Python? [duplicate] This question already has an answer here: I know that it is possible to check if a URL redirects, as mentioned in the following question and its answer. How to check if the url redirect to another url using Python using the following code: eq = urllib2.Request(url=url, headers=headers) resp = urllib2.urlopen(req, timeout=3) redirected = resp.geturl() != url # redirected will be a boolean True/False However, I have list of Millions of URLs. Currently it is discussed wether one of them is a harmful URL or redirects to a harmful URL. I want to know if it is possible to check for redirect without opening a direct connection to the redirecting website to avoid creating a connection with a harmful website? This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. Do...