Returns
list[CookieDict]: The response containing the list of cookies in the session.
Raises
ValueError: If the session hasn’t been started yet (no session_id available).
Gets cookies from the session
import json
cookies = session.get_cookies() # get the cookies from the session
with open("cookies.json", "w") as f:
json.dump(cookies, f) # save the cookies to a json file
list[CookieDict]: The response containing the list of cookies in the session.
ValueError: If the session hasn’t been started yet (no session_id available).Was this page helpful?
Suggestions