Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow preset cookies url #64

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

n-studio
Copy link

From https://www.selenium.dev/documentation/support_packages/working_with_cookies/

Add Cookie

It is used to add a cookie to the current browsing context. Add Cookie only accepts a set of defined serializable JSON object. Here is the link to the list of accepted JSON key values

First of all, you need to be on the domain that the cookie will be valid for. If you are trying to preset cookies before you start interacting with a site and your homepage is large / takes a while to load an alternative is to find a smaller page on the site (typically the 404 page is small, e.g. http://example.com/some404page)

Selenium recommends to load a small page to load the cookies before interacting with a site.

This PR allows to set a custom url to set cookies.

@start_urls = [{ url: "http://example.com", data: { preset_cookies_url: "http://example.com/some404page" } }]

(Kind of) fixes #63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting cookies will request a page twice
1 participant