• 拼多多自动浏览商品


    在网上看到一个用autojs实现的自动浏览拼多多商品的js代码感觉很有意思,但是熟悉autojs开发环境、调试摸索api等花费了我不少时间。今天我来使用一个完全不同的方法,不编程直接通过配置参数来实现,给大家提供一个参数,实现步骤如下:

    创建自动构建

    进入冰狐智能辅助https://aznfz.com,在网页端「移动端」/「自动构建脚本」中新建一个“构建”。

    通过“元数据”构造自动构建

    通过元数据可以直接复制一个完全一样的构建。在上一步创建的构建右边点击“元数据”按钮,将如下元数据拷贝进入并保存,此时系统会根据元数据自动完成模块参数配置。

    {
        "type": "root",
        "children": [{
            "type": "declareVar",
            "var": [{
                "name": "temp",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "ret",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "view",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "viewContainer",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "tag",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "item",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "index",
                "type": "normal",
                "initType": "null",
                "initValue": "null"
            }, {
                "name": "data",
                "type": "normal",
                "initType": "string",
                "initValue": ""
            }, {
                "name": "text",
                "type": "normal",
                "initType": "string",
                "initValue": ""
            }]
        }, {
            "type": "main",
            "desc": "业务逻辑入口",
            "debug": false,
            "params": [],
            "children": [{
                "type": "launchApp",
                "desc": "启动APP",
                "debug": false,
                "packageName": "com.xunmeng.pinduoduo",
                "tag": "txt:推荐#",
                "failed": "",
                "maxStep": "30",
                "children": [{
                    "type": "scroll",
                    "desc": "滚动处理",
                    "class": 1,
                    "debug": false,
                    "direction": "up",
                    "tag": "",
                    "family": [],
                    "descendant": [],
                    "widgetIndex": "0",
                    "minDistance": "0.8",
                    "maxDistance": "0.8",
                    "minScrollCount": "2",
                    "maxScrollCount": "3",
                    "minDuration": "500",
                    "maxDuration": "500",
                    "beforeWait": "1000",
                    "afterWait": "1000"
                }, {
                    "type": "loop",
                    "desc": "循环处理",
                    "class": "2",
                    "debug": false,
                    "minCount": "2",
                    "maxCount": "5",
                    "indexVarName": "index0",
                    "children": [{
                        "type": "traverse",
                        "desc": "遍历容器",
                        "class": 1,
                        "debug": false,
                        "tag": "cn:android.support.v4.view.ViewPager#",
                        "family": [1, 1],
                        "descendant": [],
                        "failed": "",
                        "traverseSelf": false,
                        "retryCount": "0",
                        "startIndex": "0",
                        "lastIndex": "0",
                        "randomPickCount": "1",
                        "clickable": false,
                        "className": "",
                        "children": [{
                            "type": "clickAndEnter",
                            "desc": "点击进入页面",
                            "class": "2",
                            "debug": false,
                            "family": [],
                            "descendant": [],
                            "checkTag": "txt:发起拼单#",
                            "mode": "2",
                            "failed": "",
                            "duration": "500",
                            "maxStep": "5",
                            "beforeWait": "0",
                            "afterWait": "0",
                            "target": "item",
                            "children": [{
                                "type": "scroll",
                                "desc": "滚动处理",
                                "class": 1,
                                "debug": false,
                                "direction": "up",
                                "tag": "",
                                "family": [],
                                "descendant": [],
                                "widgetIndex": "0",
                                "minDistance": "0.8",
                                "maxDistance": "0.8",
                                "minScrollCount": "3",
                                "maxScrollCount": "5",
                                "minDuration": "500",
                                "maxDuration": "500",
                                "beforeWait": "1000",
                                "afterWait": "3000"
                            }, {
                                "type": "back2Page",
                                "desc": "返回页面",
                                "debug": false,
                                "tag": "txt:首页#",
                                "root": "",
                                "backFirst": "true",
                                "failed": "",
                                "duration": "500",
                                "maxStep": "5",
                                "beforeWait": "0",
                                "afterWait": "0"
                            }]
                        }]
                    }, {
                        "type": "scroll",
                        "desc": "滚动处理",
                        "class": 1,
                        "debug": false,
                        "direction": "up",
                        "tag": "",
                        "family": [],
                        "descendant": [],
                        "widgetIndex": "0",
                        "minDistance": "0.8",
                        "maxDistance": "0.8",
                        "minScrollCount": "2",
                        "maxScrollCount": "3",
                        "minDuration": "500",
                        "maxDuration": "500",
                        "beforeWait": "1000",
                        "afterWait": "1000"
                    }]
                }]
            }]
        }],
        "desc": "根模块",
        "debug": false
    }

    编译运行

    1. 在网页端「移动端」/「自动构建脚本」点击右边的“编译”按钮,将自动构建编译成与自动构建名称相同的js脚本。
    2. 在网页端「移动端」/「移动端脚本」点击右边的“发布”按钮发布脚本。
    3. 在网页端「移动端」/「移动端脚本」点击右边的“运行”按钮,并选择设备,然后执行。

  • 相关阅读:
    推荐一款性价比高、功能完善的资产管理系统
    猿创征文|Spring Boot日志
    pytorch 入门 (四)案例二:人脸表情识别-VGG16实现
    无需专线、无需固定公网IP,各地安防数据如何高效上云?
    【运维面试题】访问www.baidu.com背后发生了什么·dns解析过程·ping过程
    Python潮流周刊#6:Python 3.12 有我贡献的代码!
    上一个问题的解决方式1
    怎么javaagent简单使用: 为类对象添加toString方法
    纷享销客《2022新增长系列之快消行业橙皮书》重磅发布
    短视频如何展现效果更佳?不用类型的短视频有不同的侧重点
  • 原文地址:https://blog.csdn.net/m0_62326810/article/details/125573029