【问题标题】:Having issues finding out how to do A Pyautogui delay在找出如何执行 Pyautogui 延迟时遇到问题
【发布时间】:2021-11-01 23:08:42
【问题描述】:

所以我正在尝试自动化我的漫画阅读,我遇到了找出如何为每个事件设置持续时间的麻烦。例如,如果我希望它滚动 200 秒,然后在 X 和 Y 坐标处单击下一页,我该怎么做?

注意:我了解如何让 pyautogui 点击。我更关心的是如何让它延时。

import pyautogui


speed = input('how fast should it scroll')
sleepTime = input('how long before next scroll')

pyautogui.time.sleep(3)

 

while 0 < 10:
    pyautogui.moveTo(918, 492, duration=26, tween=pyautogui.easeInOutQuad)
    pyautogui.scroll(int(speed))
    
    pyautogui.time.sleep(int(sleepTime))
    
    pyautogui.FAILSAFE = True
    

    
    
    
    
    
    

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python automation pyautogui


【解决方案1】:

取自PyAutoGUI docs

代替:

pyautogui.time.sleep(3)

这样做:

pyautogui.PAUSE = 3

【讨论】:

    猜你喜欢
    • 2016-05-01
    • 2023-02-06
    • 1970-01-01
    • 2022-10-05
    • 2013-02-08
    • 1970-01-01
    • 2012-04-19
    • 1970-01-01
    • 2019-09-07
    相关资源
    最近更新 更多