1

How can I save session cookies in python?

I know I have to open a file like this

open('cookies.txt', "w")

but I don't know how to save the cookies for each session

  • Have a look at this https://stackoverflow.com/questions/13030095/how-to-save-requests-python-cookies-to-a-file – mk23 Jun 24 '21 at 05:38

1 Answers1

0

file1 = open("myfile.txt","w")

words need to be written inside the txt file

L = ["HAI \n","Hello \n","How are you \n"]

to write inside the txt file

file1.writelines(L)

close the text file

file1.close()

Yagav
  • 190
  • 1
  • 7