Comments (6)
Cookies 是HttpOnly 的 ,设置无效 ,但是使用selenium 设置,然后刷新页面 就有效
谢谢反馈,可以告诉我是哪个网站吗?
from drissionpage.
from drissionpage.
找到原因了,不是HttpOnly的原因,是selenium add_cookie()时自动在domain前加了一个'.',导致未能覆盖浏览器新产生的cookie,如果set_cookies()前先delete_cookie('sid'),就能正常登录。
我想想解决办法。
可以给你设置有效的selenium代码我看看吗?可以加QQ详谈吗?178691442。谢谢。
from drissionpage.
临时解决办法:
cookies = ({'sid': 'xxxxxxx'}, ....)
page.get('https://xiumi.us')
page.driver.delete_cookie('sid') # 加上这句
page.set_cookies(cookies)
这个cookie二级域名前没有'.',而selenium添加cookie时会自动加'.',所以不能正确覆盖。
下个版本对这种情况做适配,目前可以先手动删除这个cookie,这样写也不会影响新版本的兼容性
from drissionpage.
Cookies 是HttpOnly 的 ,设置无效 ,但是使用selenium 设置,然后刷新页面 就有效
v1.7.8已修复这个问题,请试一下
from drissionpage.
设置cookie以后,显示未登录。设置cookie无效。。
from drissionpage.
Related Issues (20)
- --guest访客模式启动下无法多开标签
- @text()=ABC vs text:ABC 区别 HOT 1
- 截图相关bug HOT 2
- 4.1.0.0还没有上架啊 HOT 1
- 功能请求 真心希望作者能给js_run加上返回值获取, 有些操作可能会依赖js运行来获取相应的返回值
- ChromiumPage实例化bug HOT 1
- i like this project
- 做了一个fastapi接口,但是长时间没有收到请求,与浏览器就会断开
- 最新测试版4.1.0.0b19遗漏WebPageTab
- 截图功能的一个小细节
- 由于以下原因无法打开网站 Incapsula Captcha
- .states.is_in_viewport找不到元素不是返回False而是直接报错?,找到元素能正常返回True
- 已解决,字典中的值是None导致page.set.cookies 报错 HOT 1
- 动作链无法绕过cloudflare的5s盾 HOT 1
- DP是否支持拦截并修改响应内容?
- eles() method for ShadowRoot bug - Error when using both css and xpath locator
- 在linux 环境下的无头浏览器 不支持录屏
- 请问有办法解决 "chrome is being controlled by automated software" 吗?
- 获取的cookies 好像不是很全
- ChromiumPage 设置代理好像不生效
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drissionpage.