How to enable cookies in Chromedriver with Webdriver?

时光怂恿深爱的人放手 提交于 2019-12-19 19:52:50

问题


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?


回答1:


ChromeDriver has cookie be enabled by default.

Please try the following steps:

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

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

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

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.



来源:https://stackoverflow.com/questions/19211006/how-to-enable-cookies-in-chromedriver-with-webdriver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!