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

怎么用 pyautogui 模拟鼠标点击网页上指定文字啊?

  •  
  •   jin6220 · Jul 17, 2018 · 5828 views
    This topic created in 3040 days ago, the information mentioned may be changed or developed.
    怎么定位到网页上的文字
    比如 知乎网页上的赞同
    搜了一下好像没提到这个功能怎么写
    https://muxuezi.github.io/posts/doc-pyautogui.html
    6 replies  •  2018-07-20 16:16:14 +08:00
    Phant0m
    Phant0m
    Jul 17, 2018
    1
    chromeheadless 可以做
    jijiwaiwai
    jijiwaiwai
    Jul 17, 2018
    2
    selenium 方便些
    AlisaDestiny
    AlisaDestiny
    Jul 17, 2018
    3
    你要先把需要点击的文字截个图,然后用 pyautogui.locateCenterOnScreen('button.png') 方法判断 点击的位置。在去调用方法模拟点击就好了。
    sjmcefc2
    sjmcefc2
    Jul 18, 2018
    4
    @AlisaDestiny 这种会很准确的定位吗,刚才试了一下貌似没有成功。
    nature91
    nature91
    Jul 18, 2018
    5
    selenium 定位元素啊 简单的不能简单了
    jin6220
    jin6220
    OP
    Jul 20, 2018
    6
    @nature91 好的 我要好好学习这个 selenium 了 看来比 pyautogui 功能多了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2531 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 11:11 · PVG 19:11 · LAX 03:11 · JFK 06:11
    ♥ Do have faith in what you're doing.