Answer the question
In order to leave comments, you need to log in
How to save and then load cookies in PhantomJS?
Until this beautiful evening, I saved cookies in this way:
with open("cookie/1.pkl", "wb") as cookiefile:
pickle.dump(browser.get_cookies(), cookiefile)
with open("cookie/1.pkl, "rb") as cookiefile:
cookies = pickle.load(cookiefile)
for cookie in cookies:
browser.add_cookie(cookie)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question