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
  • 相关阅读:
    Java设计模式--单列设计模式
    TCP服务器端和客服端(一)
    面向对象 ---Java抽象类
    全新的代码
    黑马程序员入学基础测试(五)
    mysql 权限管理
    centos7 端口开放
    centos7 yum 安装 mysql
    centos7 安装jdk
    centos7 yum 安装jq
  • 原文地址:https://www.cnblogs.com/futrueface/p/15043255.html
Copyright © 2011-2022 走看看