Skip to content

Do we have storage_state in seleniumbase like we have it in playwright? #3825

Answered by mdmintz
juanfrilla asked this question in Q&A
Discussion options

You must be logged in to vote

There's a user_data_dir parameter that you can use to preserve the user-data-dir between scripts.
(Note that the non UC Mode user_data_dir is incompatible with one that'll be used with UC Mode.)

There are other ways to preserve data and state as well. For instance, with cookies:

There are also methods for getting and setting both local and session storage:

sb.cdp.get_local_storage_item(key)
sb.cdp.get_session_storage_item(key)
sb.cdp.set_local_storage_item(key, value)
sb.cdp.set_session_storage_item(key, value)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants