def geturl ( self ) : if self . retries is not None and len ( self . retries . history ) : return self . retries . history [ - 1 ] . redirect_location else : return self . _request_url
print original url before redirect python requests
Returns the URL that was the source of this response . If the request that generated this response redirected this method will return the final redirect location .
def geturl(self):
        """
        Returns the URL that was the source of this response.
        If the request that generated this response redirected, this method
        will return the final redirect location.
        """
        if self.retries is not None and len(self.retries.history):
            return self.retries.history[-1].redirect_location
        else:
            return self._request_url