Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想实现这里显示的内容:
使用 urllib2 登录网站 - Python 2.7
我的问题是为什么代码中需要 cookielib 和 cookiejar?为什么没有 cookielib 和 cookiejar 代码将无法工作?
谢谢你。
当您登录网站时,他们通常会给您一个“cookie”。当您从同一站点加载另一个页面时,您可以向他们显示此 cookie 以让他们知道您是谁。
cookie jar 是一种为您管理它的数据结构。
没有它,您将无法保持登录状态。