Giter Club home page Giter Club logo

pywinauto-demo's Introduction

pywinauto-demo

a simple demo for pywinauto to auto click gui in win10 on chrome 73

Task: to use auto tool(pywinauto) to close all the tip windows when started the jitisi website(https://map.1tyun.ink:8903/new)

  1. firstly successfully installed pywinauto and use it:

face problem - cannot found module pywinauto even already installed using pip (Python)

bc pywinauto have bug when using python 3.8 (上网查了原因是pywinauto有bug,Python之后的版本都会报错,所以尝试用python3.7运行,但是可能pip安装也不对,所以就用了pipenv这个不同版本协调的类似pip工具 -

https://www.zhihu.com/question/368411359)

  1. use desktop() method to successfully recognize handle, others failed
Desktop(backend="uia").window(title_re='1tvideo') # success
''' fail1 '''
# app.window_(title='New Tab') 
''' fail2 '''
# app_new_tab = Application(backend='uia').connect(\
#     path='D:\\computer\\tools\\googlechrome73\\Google Chrome\\chrome.exe',\
#      title_re='New Tab')
  1. always have problem:
C:\Users\16593\.virtualenvs\juiti-QRFUgQcO\lib\site-packages\pywinauto\application.py:1076: RuntimeWarning: Application is not loaded correctly (WaitForInputIdle failed)
  warnings.warn('Application is not loaded correctly (WaitForInputIdle failed)', RuntimeWarning)

solution:

chrome_dir = r"D:\\computer\\tools\\googlechrome73\\Google Chrome\\chrome.exe"
app = Application(backend="uia").start(\
    chrome_dir + \
    ' --force-renderer-accessibility'\
    + ' https://map.1tyun.ink:8903/new"', # timeout=20,
    wait_for_idle=False)
  • Add another parameter 'wait_for_idle=False'

pywinauto-demo's People

Contributors

jellyxuuuuu avatar

Watchers

 avatar

Forkers

jaimerh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.