• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    Python+uiautomator2实现自动刷抖音视频功能

    工具准备

    安装adb

    官网地址:https://developer.android.google.cn/studio/command-line/adb

    下载好解压后设置环境变量即可

    安装uiautomatorviewer

    参照此篇文章:https://www.cnblogs.com/corsacsherry/p/10609339.html

    调试工具

    Python安装uiautomator2

    pip install --pre -U uiautomator2

    给设备安装atx-agent

    python -m uiautomator2 init

    注意打开设备,允许uiautomator.apk的安装
    参考连接:https://blog.csdn.net/plychoz/article/details/80231550

    编写主程序

    定位抖音位置

    几种定位方式如下:

    text:a(text=“抖音极速版”).click()resourceid:a(resourceId=“com.smartisanos.clock:id/text_stopwatch”).click()classname:a(className=“android.widget.TextView”).click()description :a(description="…").click()

    import uiautomator2 as d
    import time
    def douyin():
        #通过usb连接
        a=d.connect_usb('3d51a18c')
       	# 打开抖音
        a(text="抖音极速版").click()
        while True:
            time.sleep(10)
        	# 滑动视频
            a.swipe(313,1370,313,110)
    
    if __name__=='__main__':
        douyin()

    点击运行即可

    到此这篇关于Python+uiautomator2实现自动刷抖音视频的文章就介绍到这了,更多相关Python自动刷抖音视频内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

    您可能感兴趣的文章:
    • Python绘图库Matplotlib的基本用法
    • Python matplotlib实用绘图技巧汇总
    • Python+uiautomator2实现手机锁屏解锁功能
    • python 使用uiautomator2连接手机设备的实现
    • python使用matplotlib显示图像失真的解决方案
    • 基于python的matplotlib制作双Y轴图
    • 用Python的绘图库(matplotlib)绘制小波能量谱
    • python matplotlib绘图实现删除重复冗余图例的操作
    • Python基础之画图神器matplotlib
    • python保存大型 .mat 数据文件报错超出 IO 限制的操作
    上一篇:Django表单外键选项初始化的问题及解决方法
    下一篇:教你如何使用Python下载B站视频的详细教程
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    Python+uiautomator2实现自动刷抖音视频功能 Python+uiautomator2,实现,自动,