Python 官方文档:入门教程 => 点击学习
工具准备 python3.7.7 adb(Android debug bridge) uiautomatorviewer 安装adb 官网地址:https
官网地址:https://developer.android.Google.cn/studio/command-line/adb
下载好解压后设置环境变量即可
参照此篇文章:Https://www.cnblogs.com/corsacsherry/p/10609339.html
adb devices -l
命令查看已连接的设备
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自动刷抖音视频内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
--结束END--
本文标题: Python+uiautomator2实现自动刷抖音视频功能
本文链接: https://www.lsjlt.com/news/124912.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0