python3 获取request 302跳转后最终的URL

1,087 阅读1分钟

python3 获取request 302跳转后最终的URL 代码:

    import requests
    resp = requests.get(rtsp_url, timeout=(3, 7))
if len(resp.history) > 0:
	location_url = resp.history[len(resp.history) - 1].headers.get('Location')