如何使用 Webdriver 在 Chromedriver 中启用 cookie? [英] How to enable cookies in Chromedriver with Webdriver?

查看:310
本文介绍了如何使用 Webdriver 在 Chromedriver 中启用 cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Selenium 的 Chromedriver 登录启用了 cookie 的网站.我从服务器收到一条消息,说浏览器禁用了 cookie.如何在 Chromedriver 中启用 Cookie?

I am trying to use Selenium's Chromedriver to log in to a website which has cookies enabled. I got a message from the server that the browser has cookies disabled. How can I enable cookies in Chromedriver?

推荐答案

ChromeDriver 已默认启用 cookie.

ChromeDriver has cookie be enabled by default.

请尝试以下步骤:

  1. 使用 FirefoxDriver/IEDriver,看看网站怎么说.

  1. Use FirefoxDriver/IEDriver, see what the site says.

手动打开 Chrome 浏览器,查看网站内容.

Manually open a Chrome browser, see what the site says.

尝试使用 ChromeDriver 打开的浏览器打开 whatismybrowser.com,看看它告诉你什么.

Try open whatismybrowser.com with ChromeDriver opened browser, see what it tells you.

如果您的网站显示未为 FirefoxDriver/IEDriver/手动打开的 Chrome 启用 cookie,并且 whatismybrowser.com 显示您的 ChromeDriver 已打开浏览器启用了 cookie,那么您的网站显然有问题,请尝试调试您的网站.

If your site says cookie not enabled for FirefoxDriver/IEDriver/Manually opened Chrome, and whatismybrowser.com says your ChromeDriver opened browser has cookie enabled, then clearly something is wrong with your site, please try debug your site.

这篇关于如何使用 Webdriver 在 Chromedriver 中启用 cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆