推荐学习书目
› 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
Nepheshel
V2EX  ›  Python

selenium 填入 cookie 登入网站 其他网站可以 www2.baidu.com 不能存入 cookie 请问这是什么原因 要如何才能越过登陆 www2.baidu.com

  •  
  •   Nepheshel · Jun 11, 2018 · 3230 views
    This topic created in 3027 days ago, the information mentioned may be changed or developed.
    url = 'https://www2.baidu.com'
    options = webdriver.ChromeOptions()
    options.add_argument('lang=zh_CN.UTF-8')
    options.add_argument("user-agent='Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36'")
    browser = webdriver.Chrome(chrome_options=options)
    browser.get(url)
    cookie1 = {}
    .
    .
    .
    browser.add_cookie(cookie1)
    .
    .
    .
    time.sleep(3)
    browser.refresh()
    2 replies  •  2018-06-11 09:34:16 +08:00
    golmic
        1
    golmic  
       Jun 11, 2018 via Android
    百度登录,模拟一下 RSA 加密过程,可以用模拟请求的方式做
    Nepheshel
        2
    Nepheshel  
    OP
       Jun 11, 2018
    @golmic
    编程新手 刚学习 python 模拟请求指的是 用 request post 方式吗
    主要我想实现自动登陆 点击下载图标 下载每日数据表
    selenium 这个方法看上去 只要找到对应 html 元素 就可以点击下载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1022 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 242ms · UTC 23:18 · PVG 07:18 · LAX 16:18 · JFK 19:18
    ♥ Do have faith in what you're doing.