V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wind198501
V2EX  ›  Python

怎么用python带上保存好的cookies打开默认浏览器?

  •  
  •   wind198501 · 2013-01-31 14:15:03 +08:00 · 4899 次点击
    这是一个创建于 4103 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我将登录网站的cookies已保存为文件,想用python带上cookies文件打开系统默认的浏览器进行自动登录操作,不知道怎么实现。一定要系统默认浏览器打开啊,求教了
    4 条回复    1970-01-01 08:00:00 +08:00
    xupefei
        1
    xupefei  
       2013-01-31 14:27:51 +08:00
    自己写一个网页, 里面用 POST 登陆,然后用默认浏览器打开这个页面。因为 JS 设置 cookie 可能会有跨域问题……
    详情可参考 Dropbox 客户端的 Launch Dropbox website 的做法。
    yangg
        2
    yangg  
       2013-01-31 14:27:56 +08:00
    是自己的网站么?类似qq点击进qq空间这种一般都是传一个clientkey的吧
    Part
        3
    Part  
       2013-01-31 14:54:49 +08:00
    windows?
    将cookies文件拷贝到浏览器cookies目录,then,打开浏览器,then ,自动登录,then,o.
    lerry
        4
    lerry  
       2013-01-31 17:32:34 +08:00
    我用的Chrome,用python把得到的cookie处理成特定格式,使用“Edit this cookie”这个插件导入,就ok了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2310 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 01:00 · PVG 09:00 · LAX 18:00 · JFK 21:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.