如何从Java中HtmlUnit提供的无头浏览器中删除cookie?

发布于 2024-08-17 18:48:12 字数 206 浏览 5 评论 0原文

我正在使用 HtmlUnit 无头浏览器访问网站。

当我使用无头浏览器时,这些网站发送的 cookie 可以存储在我的计算机上吗?

如果是,那么这些 cookie 保存的位置是什么?如何通过 HtmlUnit 将其删除?

I am using HtmlUnit headless browser to access websites.

Can the cookies sent by those websites store on my computer when I use that headless browser?

If yes, then what's the location where these cookies get saved and how can I remove it through HtmlUnit?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰葑 2024-08-24 18:48:12

使用 <强>HtmlUnit.removeCookie()。通常,HtmlUnit 中的 Cookie 是在内存中创建的,而不是序列化到磁盘。

Use HtmlUnit.removeCookie(). Typically the Cookies in HtmlUnit are created in memory and not serialized to disk.

一指流沙 2024-08-24 18:48:12

我正在使用

webClient.getCookieManager().clearCookies();

I'm using

webClient.getCookieManager().clearCookies();

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文