推荐学习书目
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 · 5450 views
    This topic created in 2870 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
        1
    Phant0m  
       Jul 17, 2018
    chromeheadless 可以做
    jijiwaiwai
        2
    jijiwaiwai  
       Jul 17, 2018
    selenium 方便些
    AlisaDestiny
        3
    AlisaDestiny  
       Jul 17, 2018
    你要先把需要点击的文字截个图,然后用 pyautogui.locateCenterOnScreen('button.png') 方法判断 点击的位置。在去调用方法模拟点击就好了。
    sjmcefc2
        4
    sjmcefc2  
       Jul 18, 2018
    @AlisaDestiny 这种会很准确的定位吗,刚才试了一下貌似没有成功。
    nature91
        5
    nature91  
       Jul 18, 2018
    selenium 定位元素啊 简单的不能简单了
    jin6220
        6
    jin6220  
    OP
       Jul 20, 2018
    @nature91 好的 我要好好学习这个 selenium 了 看来比 pyautogui 功能多了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1638 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 16:26 · PVG 00:26 · LAX 09:26 · JFK 12:26
    ♥ Do have faith in what you're doing.