我想捕获cookie以便以后登录网站,我需要得到它,X-CSRFToken的东西,稍后在post命令中传递它,这是我的一段代码
import requests
url = "https://accounts.coursera.org/signin?post_redirect=https%3A%2F%2Fwww.coursera.org%2F"
r = requests.get(url)
r.cookies['example_cookie_name']
错误是:
KeyError: "name='example_cookie_name', domain=None, path=None"