Closed eserte closed 3 years ago
This is pretty awful, but it looks like it's a webdriver thing. Reference is at https://developer.mozilla.org/en-US/docs/Web/WebDriver/Errors/InvalidCookieDomain
I've added a comment to this effect in the documentation for add_cookie and pushed the commit. Does that seem acceptable?
Documentation-only is fine, but the current wording seems strange. Maybe "This method cannot thrown an exception ..." -> "This method throws an exception ..."?
zonk fixed and pushed.
If using
add_cookie
before loading a page, then an exception happens. A sample script:Output:
The first output line probably gives the answer: cookies can probably be only set for "real" pages. A workaround could be: preload the URL. (Using another domain wouldn't work, this would lead to the error
invalid cookie domain: Cookies may only be set for the current domain (...)
)Is there a possibility to set the cookie before loading the (possibly heavy) page? If not, then maybe this restriction should be documented?