L
L
LordGod2022-01-26 21:41:33
Python
LordGod, 2022-01-26 21:41:33

How to convert cookies to requests-friendly format?

Hello, I have cookies in .pkl format that I collect through selenium.
Then I need to use these cookies in requests.
Simply connecting cookies as a file or dictionary does not work.
Tell me how to convert them to the desired format.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
igorzakhar, 2022-01-26
@igorzakhar

import pickle

with open('filename.pkl', 'rb') as fd:
    data = pickle.load(fd)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question