我必须使用 Watir 和 Chrome 浏览器删除一个网站。该站点需要多个位置选择器才能打开。我需要在 cookie 中设置位置参数。
我已经使用了这个 URL 中列出的方法: http://watir.com/guides/cookies/
On running the code I got the following error: Failed to set the 'cookie' property on 'Document': Cookies are disabled inside 'data:' URLs. (Selenium::WebDriver::Error::NoScriptResultError)
最佳答案
browser.cookies.add 'foo', 'bar', path: '/', expires: 10.days.from_now, secure: true
引用:Watir
关于ruby - 如何在 Watir 中设置 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48095104/