zoukankan      html  css  js  c++  java
  • 微信运动圈自动点赞(自动跳过自己)

    import uiautomator2 as u2

    d = u2.connect('172.20.25.212:5555')
    d.implicitly_wait(5)
    rid = '//*[@resource-id="com.tencent.mm:id/c68"]'
    LLayout = '/android.widget.LinearLayout'
    RLayout = '/android.widget.RelativeLayout'
    TView = '/android.widget.TextView'
    VGroup = 'android.view.ViewGroup'
    IView = '/android.widget.ImageView'
    View = '/android.view.View'

    rid_RLayout = rid + RLayout
    LLayout1_RLayout2 = LLayout + "[1]" + RLayout + "[2]"
    RLayout1_RLayout1 = LLayout + "[1]" + RLayout + "[1]" + View

    i = 1
    position = []
    me_Name = d.xpath(
    rid + RLayout + '[2]' + LLayout1_RLayout2 + RLayout1_RLayout1).get_text()
    while True:
    try:
    ele_path = d.xpath(
    rid_RLayout + "[" + str(i) + "]" + LLayout1_RLayout2 + RLayout + "[2]" + RLayout + "[1]" + IView + "[1]")
    ele_name = d.xpath(rid_RLayout + "[" + str(i) + "]" + LLayout1_RLayout2 + RLayout1_RLayout1).get_text()
    if ele_name == me_Name:
    continue
    x, y = ele_path.center()
    if i == 1:
    position.append([x, y])
    position.append([x, y])
    else:
    position[1] = [x, y]
    if ele_path.exists:
    ele_path.click()
    print(ele_name + '微信运动已点赞')
    except Exception as e:
    d.drag(position[1][0], position[1][1], position[0][0], position[0][1])
    i = 0
    finally:
    i += 1
  • 相关阅读:
    Mysql事务隔离级
    51nod1076(tarjan)
    求无向图的割点和桥模板(tarjan)
    51nod1770(xjb)
    51nod1640(kruscal)
    51nod1639(组合数学)
    51nod1625(枚举&贪心)
    51nod1562(set&模拟)
    51nod1483(打表)
    51nod1475(贪心&枚举)
  • 原文地址:https://www.cnblogs.com/futrueface/p/15043255.html
Copyright © 2011-2022 走看看