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

请教 selenium 中的鼠标动作为何不工作呢?

  •  
  •   jahan · Nov 21, 2017 · 3030 views
    This topic created in 3232 days ago, the information mentioned may be changed or developed.

    safari 11(highserria) 环境,有一个 element 需要鼠标 hover 上才能显示,想实现 hover 并点击的动作,可是在给足了加载时间之后,执行下面的代码,鼠标不悬停 element 不显示。 zoom_out_button = driver.find_element_by_class_name('zoom-out-right-button-control-bar') print('Visiable?', zoom_out_button.is_displayed()) fasle ActionChains(driver).move_to_element(zoom_out_button).click(zoom_out_button).perform() 想请教一下为什么 action 不工作呢?下面是目标 js。也就是 https://www.tradingview.com/chart/f8my3Ybg 图表下方的放大缩小图标。google 说 safari 和 chrome 有个缺陷,不过确认了不是我这个版本。有点闹不明白了。

    ………… http://www.w3.org/2000/svg" viewbox="0 0 120 120" width="16" height="16" class="zoom-out-right-button-control-bar"> …… <
    3 replies  •  2017-11-21 13:50:25 +08:00
    kran
        1
    kran  
       Nov 21, 2017 via iPhone
    直接修改 css 不可以吗
    jahan
        2
    jahan  
    OP
       Nov 21, 2017
    @kran google 过程中看到过这个思路,就是没看到代码,不知道要去学那部分知识
    kran
        3
    kran  
       Nov 21, 2017
    不是有 executeScript 吗,用它来修改样式呀
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   882 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 22:13 · PVG 06:13 · LAX 15:13 · JFK 18:13
    ♥ Do have faith in what you're doing.