Giter VIP home page Giter VIP logo

Comments (5)

g1879 avatar g1879 commented on May 30, 2024

Cookies 是HttpOnly 的 ,设置无效 ,但是使用selenium 设置,然后刷新页面 就有效

谢谢反馈,可以告诉我是哪个网站吗?

from drissionpage.

CL545740896 avatar CL545740896 commented on May 30, 2024

https://xiumi.us

from drissionpage.

g1879 avatar g1879 commented on May 30, 2024

https://xiumi.us

找到原因了,不是HttpOnly的原因,是selenium add_cookie()时自动在domain前加了一个'.',导致未能覆盖浏览器新产生的cookie,如果set_cookies()前先delete_cookie('sid'),就能正常登录。
我想想解决办法。
可以给你设置有效的selenium代码我看看吗?可以加QQ详谈吗?178691442。谢谢。

from drissionpage.

g1879 avatar g1879 commented on May 30, 2024

https://xiumi.us

临时解决办法:
cookies = ({'sid': 'xxxxxxx'}, ....)
page.get('https://xiumi.us')
page.driver.delete_cookie('sid') # 加上这句
page.set_cookies(cookies)

这个cookie二级域名前没有'.',而selenium添加cookie时会自动加'.',所以不能正确覆盖。
下个版本对这种情况做适配,目前可以先手动删除这个cookie,这样写也不会影响新版本的兼容性

from drissionpage.

g1879 avatar g1879 commented on May 30, 2024

Cookies 是HttpOnly 的 ,设置无效 ,但是使用selenium 设置,然后刷新页面 就有效

v1.7.8已修复这个问题,请试一下

from drissionpage.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.