在用selenium添加cookie时遇到了“Can only set Cookies for the current domain”错误,经过一番搜索验证。
问题原因大概如下:某些网页里面用了一些selenium不支持的cookie键。 以前使用浏览器登录网站,查看cookie,使用requests库进行模拟登录没有问题。使用selenium登录不可以,会出现如题的提示。
问题解决:使用selenium登录后,查看cookie,并保存,再用这个cookie进行登录就没有问题了。
在用selenium添加cookie时遇到了“Can only set Cookies for the current domain”错误,经过一番搜索验证。
问题原因大概如下:某些网页里面用了一些selenium不支持的cookie键。 以前使用浏览器登录网站,查看cookie,使用requests库进行模拟登录没有问题。使用selenium登录不可以,会出现如题的提示。
问题解决:使用selenium登录后,查看cookie,并保存,再用这个cookie进行登录就没有问题了。
本文标题:Selenium在添加cookie时“Can only set
本文链接:https://www.haomeiwen.com/subject/dannpftx.html
网友评论