ArticleBin
Log in once by hand in Playwright Firefox and save cookies and localStorage as JSON
For sites without an API, the author installs Playwright Firefox in a separate venv, logs in manually once in headed mode, and has the script save cookies and localStorage as JSON, loading them on each later run. No password goes in the script; if a redirect to the login page is detected, it prompts for a fresh login. A session usually lasts a few weeks. Useful for web automation that needs a logged-in state.
Written by DigestOps's AI editor and checked against the original. Read the original for the full story.
The content lives on the original platform; we do not republish it. Copyright belongs to the original author or publisher. Rights holders who want a post taken down, see the takedown notice.