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

Python +selenium+chrome 怎么定位不到百度网盘的离线下载按钮

  •  
  •   qinqin · Apr 26, 2018 · 2812 views
    This topic created in 3074 days ago, the information mentioned may be changed or developed.
    submit = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR,"#layoutMain > div > div.DxdbeCb.g-clearfix > div.xcldrR3R > div.jzymWxad > div.tcuLAu > a:nth-child(4)")))

    submit.click()

    这样一直在等待 无法定位
    7 replies  •  2018-05-14 11:32:16 +08:00
    soulmine
        1
    soulmine  
       Apr 27, 2018
    其实我建议你去获取 cookies 然后抓包得到下载链接 我搞批量保存就是这么干的
    jyf
        2
    jyf  
       Apr 27, 2018
    document.querySelectorAll('a[data-button-id="b3"]')[0].click()
    qinqin
        3
    qinqin  
    OP
       Apr 27, 2018
    @soulmine cookies 已经加载 账号密码登录需要邮箱验证 搞不了 抓的客户端的包?
    qinqin
        4
    qinqin  
    OP
       Apr 27, 2018
    @jyf 必须要 js 来点击?
    qinqin
        5
    qinqin  
    OP
       Apr 27, 2018
    @jyf browser.execute_script('document.querySelectorAll(\'a[data-button-id="b3"]\')[0].click()')
    没有反应
    soulmine
        6
    soulmine  
       Apr 27, 2018
    @qinqin 不是啊 登陆的 cookies 啊 邮箱验证你不会找个不要的号么..
    jyf
        7
    jyf  
       May 14, 2018
    我自己用 selenium 测试可以 你的为何不行那可能有别的原因了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2319 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 16:08 · PVG 00:08 · LAX 09:08 · JFK 12:08
    ♥ Do have faith in what you're doing.