Python 3.x Python请求,然后从响应中再次请求

Python 3.x Python请求,然后从响应中再次请求,python-3.x,parsing,python-requests,Python 3.x,Parsing,Python Requests,您好,我正在尝试通过请求登录instagram,并且已经这样做了。在我发布数据后,我得到一个响应“需要挑战”,如图所示: b'{"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/935162/Pp9fvRmVZ4/", "api_path": &quo

您好,我正在尝试通过请求登录instagram,并且已经这样做了。在我发布数据后,我得到一个响应“需要挑战”,如图所示:

b'{"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/935162/Pp9fvRmVZ4/", "api_path": "/challenge/935162/Pp9fvRmVZ4/", "hide_webview_header": true, "lock": true, "logout": false, "native_flow": true}, "status": "fail", "error_type": "checkpoint_challenge_required"}'

正如您所看到的,有一个新的instagram url而不是登录名,我想解析这个新的url,然后发布我的新负载,这是一个代码。我该怎么做

编辑: 我解析了json并获取了新的url,但它没有说明我是否通过了所需的挑战:

        r = requests.post("https://i.instagram.com/api/v1/accounts/login/", data=Payload, headers=headers)
        j = r.json()  # converts the response to a dictionary
        url2 = j['challenge']['url']
        requests.post(url=url2, data=sus_code, headers=headers)
        print(r.content)
这是我的密码,提前谢谢