十九:爬虫最终篇-平安银行商城实战

news2024/11/24 16:43:14

平安银行商场实战

需求

获取该商城商品信息

目标网址

https://m.yqb.com/bank/product-item-50301196.html?mcId=1583912328849970&loginMode=pab&history=y&sceneMode=m&traceid=30187_4dXJVel1iop

详细步骤

1、寻找数据接口

image.png

2、对比payload寻找可疑参数

image.png

3、多次重放请求确定反爬参数

image.png
这一块也就是说这三个参数咱们都需要进行处理

4、下xhr断点并堆栈回溯寻找加密位置

image.png
_对象值
image.png

5、进入g.default()函数内部

image.png
image.png

6、找到webpack加载器

image.png

7、扣出加载器

image.png
image.png

8、测试加载器并补window全局变量

image.png
image.png

var get_sign;
window = global
!function (e) {
    function t(t) {
        for (var o, a, u = t[0], s = t[1], c = t[2], l = 0, f = []; l < u.length; l++)
            a = u[l],
            Object.prototype.hasOwnProperty.call(r, a) && r[a] && f.push(r[a][0]),
                r[a] = 0;
        for (o in s)
            Object.prototype.hasOwnProperty.call(s, o) && (e[o] = s[o]);
        for (d && d(t); f.length;)
            f.shift()();
        return i.push.apply(i, c || []),
            n()
    }

    function n() {
        for (var e, t = 0; t < i.length; t++) {
            for (var n = i[t], o = !0, a = 1; a < n.length; a++) {
                var s = n[a];
                0 !== r[s] && (o = !1)
            }
            o && (i.splice(t--, 1),
                e = u(u.s = n[0]))
        }
        return e
    }

    var o = {}
        , a = {
        67: 0
    }
        , r = {
        67: 0
    }
        , i = [];

    function u(t) {
        if (o[t])
            return o[t].exports;
        var n = o[t] = {
            i: t,
            l: !1,
            exports: {}
        };

        return e[t].call(n.exports, n, n.exports, u),
            n.l = !0,
            n.exports
    }
    get_sign = u
    u.e = function (e) {
        var t = [];
        a[e] ? t.push(a[e]) : 0 !== a[e] && {
            3: 1,
            4: 1,
            7: 1,
            11: 1,
            12: 1,
            13: 1,
            15: 1,
            16: 1,
            17: 1,
            18: 1,
            19: 1,
            20: 1,
            21: 1,
            22: 1,
            23: 1,
            24: 1,
            25: 1,
            26: 1,
            27: 1,
            28: 1,
            29: 1,
            30: 1,
            31: 1,
            32: 1,
            33: 1,
            34: 1,
            35: 1,
            36: 1,
            37: 1,
            38: 1,
            39: 1,
            40: 1,
            41: 1,
            42: 1,
            43: 1,
            44: 1,
            46: 1,
            47: 1,
            48: 1,
            49: 1,
            50: 1,
            51: 1,
            53: 1,
            54: 1,
            55: 1,
            56: 1,
            57: 1,
            58: 1,
            59: 1,
            60: 1,
            61: 1,
            62: 1,
            63: 1,
            65: 1,
            66: 1
        }[e] && t.push(a[e] = new Promise((function (t, n) {
                for (var o = "client." + ({
                    3: "address~afterSaleRepCard~applyAfterSale~applyRefund~comment~exchangedLog~giftcouponbind~invoice~invo~2935f755",
                    4: "components-detail",
                    7: "shelves",
                    8: "address~logisticsDetail~neworderlist~singleLogisticsDetail",
                    11: "address",
                    12: "bankMine",
                    13: "invoiceDesc",
                    14: "swiper",
                    15: "addcoupon",
                    16: "afterSaleDetail",
                    17: "afterSaleRecords",
                    18: "afterSaleRepCard",
                    19: "agreement",
                    20: "agreementlist",
                    21: "applyAfterSale",
                    22: "applyRefund",
                    23: "bankequity",
                    24: "bankminewithtab",
                    25: "banktransit",
                    26: "bindcoupon",
                    27: "cart",
                    28: "cartwithtab",
                    29: "comment",
                    30: "confirm",
                    31: "couponDetail",
                    32: "couponsDetail",
                    33: "couponsMine",
                    34: "detail",
                    35: "exchangedLog",
                    36: "exchangedResult",
                    37: "exchangedmsg",
                    38: "giftcouponbind",
                    39: "giftcoupondescription",
                    40: "giftcouponlist",
                    41: "homewithtab",
                    42: "invoice",
                    43: "invoiceList",
                    44: "logisticsDetail",
                    45: "middle-page",
                    46: "newAfterSaleDetail",
                    47: "newConfirm",
                    48: "newcart",
                    49: "neworderdetail",
                    50: "neworderlist",
                    51: "oldduobao",
                    52: "protocol",
                    53: "resultPage",
                    54: "search",
                    55: "searchitems",
                    56: "share-sku",
                    57: "shoplist",
                    58: "similarRecommendation",
                    59: "singleLogisticsDetail",
                    60: "smspayinfo",
                    61: "snapshot",
                    62: "tescogoldselimit",
                    63: "tescogoldselimit/rule",
                    64: "test",
                    65: "viewInvoice",
                    66: "voucher"
                }[e] || e) + "." + {
                    3: "7609b4ca",
                    4: "1be3b73f",
                    7: "622e5375",
                    8: "888632dd",
                    11: "a302e24b",
                    12: "f06ccc88",
                    13: "e4361099",
                    14: "f47deb8c",
                    15: "ffed5cc2",
                    16: "057ac3f6",
                    17: "55c27153",
                    18: "4f79687a",
                    19: "218a1b76",
                    20: "69a5851c",
                    21: "281cdb68",
                    22: "060c1c16",
                    23: "a7b951dd",
                    24: "bea8f367",
                    25: "9a420067",
                    26: "77a09c1c",
                    27: "09737d34",
                    28: "42b66400",
                    29: "a7cfe0a3",
                    30: "60bc7aa0",
                    31: "956df709",
                    32: "9aec682d",
                    33: "d7253fe6",
                    34: "236371b5",
                    35: "041b55c8",
                    36: "d7b76456",
                    37: "520bfc41",
                    38: "50e5db08",
                    39: "714a5a09",
                    40: "e51d401e",
                    41: "f5c12de9",
                    42: "f8e8233c",
                    43: "e0ab78b3",
                    44: "e9a1201a",
                    45: "fa8c116e",
                    46: "fda66eba",
                    47: "a348bc4b",
                    48: "183ae3f8",
                    49: "11d89753",
                    50: "479fdf05",
                    51: "8597ee65",
                    52: "1aaba5a7",
                    53: "76c6e007",
                    54: "89ac7c46",
                    55: "79746349",
                    56: "bc710170",
                    57: "81bcefbb",
                    58: "88df4e53",
                    59: "ca94543a",
                    60: "80e96a4a",
                    61: "b16c4112",
                    62: "2f2d00d6",
                    63: "1e8d18b3",
                    64: "3615d5d9",
                    65: "552d4933",
                    66: "e57872a8"
                }[e] + ".css", r = u.p + o, i = document.getElementsByTagName("link"), s = 0; s < i.length; s++) {
                    var c = (d = i[s]).getAttribute("data-href") || d.getAttribute("href");
                    if ("stylesheet" === d.rel && (c === o || c === r))
                        return t()
                }
                var l = document.getElementsByTagName("style");
                for (s = 0; s < l.length; s++) {
                    var d;
                    if ((c = (d = l[s]).getAttribute("data-href")) === o || c === r)
                        return t()
                }
                var f = document.createElement("link");
                f.rel = "stylesheet",
                    f.type = "text/css",
                    f.onload = t,
                    f.onerror = function (t) {
                        var o = t && t.target && t.target.src || r
                            , i = new Error("Loading CSS chunk " + e + " failed.\n(" + o + ")");
                        i.request = o,
                            delete a[e],
                            f.parentNode.removeChild(f),
                            n(i)
                    }
                    ,
                    f.href = r,
                    document.getElementsByTagName("head")[0].appendChild(f)
            }
        )).then((function () {
                a[e] = 0
            }
        )));
        var n = r[e];
        if (0 !== n)
            if (n)
                t.push(n[2]);
            else {
                var o = new Promise((function (t, o) {
                        n = r[e] = [t, o]
                    }
                ));
                t.push(n[2] = o);
                var i, s = document.createElement("script");
                s.charset = "utf-8",
                    s.timeout = 120,
                u.nc && s.setAttribute("nonce", u.nc),
                    s.src = function (e) {
                        return u.p + "client." + ({
                            3: "address~afterSaleRepCard~applyAfterSale~applyRefund~comment~exchangedLog~giftcouponbind~invoice~invo~2935f755",
                            4: "components-detail",
                            7: "shelves",
                            8: "address~logisticsDetail~neworderlist~singleLogisticsDetail",
                            11: "address",
                            12: "bankMine",
                            13: "invoiceDesc",
                            14: "swiper",
                            15: "addcoupon",
                            16: "afterSaleDetail",
                            17: "afterSaleRecords",
                            18: "afterSaleRepCard",
                            19: "agreement",
                            20: "agreementlist",
                            21: "applyAfterSale",
                            22: "applyRefund",
                            23: "bankequity",
                            24: "bankminewithtab",
                            25: "banktransit",
                            26: "bindcoupon",
                            27: "cart",
                            28: "cartwithtab",
                            29: "comment",
                            30: "confirm",
                            31: "couponDetail",
                            32: "couponsDetail",
                            33: "couponsMine",
                            34: "detail",
                            35: "exchangedLog",
                            36: "exchangedResult",
                            37: "exchangedmsg",
                            38: "giftcouponbind",
                            39: "giftcoupondescription",
                            40: "giftcouponlist",
                            41: "homewithtab",
                            42: "invoice",
                            43: "invoiceList",
                            44: "logisticsDetail",
                            45: "middle-page",
                            46: "newAfterSaleDetail",
                            47: "newConfirm",
                            48: "newcart",
                            49: "neworderdetail",
                            50: "neworderlist",
                            51: "oldduobao",
                            52: "protocol",
                            53: "resultPage",
                            54: "search",
                            55: "searchitems",
                            56: "share-sku",
                            57: "shoplist",
                            58: "similarRecommendation",
                            59: "singleLogisticsDetail",
                            60: "smspayinfo",
                            61: "snapshot",
                            62: "tescogoldselimit",
                            63: "tescogoldselimit/rule",
                            64: "test",
                            65: "viewInvoice",
                            66: "voucher"
                        }[e] || e) + "." + {
                            3: "7609b4ca",
                            4: "1be3b73f",
                            7: "622e5375",
                            8: "888632dd",
                            11: "a302e24b",
                            12: "f06ccc88",
                            13: "e4361099",
                            14: "f47deb8c",
                            15: "ffed5cc2",
                            16: "057ac3f6",
                            17: "55c27153",
                            18: "4f79687a",
                            19: "218a1b76",
                            20: "69a5851c",
                            21: "281cdb68",
                            22: "060c1c16",
                            23: "a7b951dd",
                            24: "bea8f367",
                            25: "9a420067",
                            26: "77a09c1c",
                            27: "09737d34",
                            28: "42b66400",
                            29: "a7cfe0a3",
                            30: "60bc7aa0",
                            31: "956df709",
                            32: "9aec682d",
                            33: "d7253fe6",
                            34: "236371b5",
                            35: "041b55c8",
                            36: "d7b76456",
                            37: "520bfc41",
                            38: "50e5db08",
                            39: "714a5a09",
                            40: "e51d401e",
                            41: "f5c12de9",
                            42: "f8e8233c",
                            43: "e0ab78b3",
                            44: "e9a1201a",
                            45: "fa8c116e",
                            46: "fda66eba",
                            47: "a348bc4b",
                            48: "183ae3f8",
                            49: "11d89753",
                            50: "479fdf05",
                            51: "8597ee65",
                            52: "1aaba5a7",
                            53: "76c6e007",
                            54: "89ac7c46",
                            55: "79746349",
                            56: "bc710170",
                            57: "81bcefbb",
                            58: "88df4e53",
                            59: "ca94543a",
                            60: "80e96a4a",
                            61: "b16c4112",
                            62: "2f2d00d6",
                            63: "1e8d18b3",
                            64: "3615d5d9",
                            65: "552d4933",
                            66: "e57872a8"
                        }[e] + ".js"
                    }(e);
                var c = new Error;
                i = function (t) {
                    s.onerror = s.onload = null,
                        clearTimeout(l);
                    var n = r[e];
                    if (0 !== n) {
                        if (n) {
                            var o = t && ("load" === t.type ? "missing" : t.type)
                                , a = t && t.target && t.target.src;
                            c.message = "Loading chunk " + e + " failed.\n(" + o + ": " + a + ")",
                                c.name = "ChunkLoadError",
                                c.type = o,
                                c.request = a,
                                n[1](c)
                        }
                        r[e] = void 0
                    }
                }
                ;
                var l = setTimeout((function () {
                        i({
                            type: "timeout",
                            target: s
                        })
                    }
                ), 12e4);
                s.onerror = s.onload = i,
                    document.head.appendChild(s)
            }
        return Promise.all(t)
    }
        ,
        u.m = e,
        u.c = o,
        u.d = function (e, t, n) {
            u.o(e, t) || Object.defineProperty(e, t, {
                enumerable: !0,
                get: n
            })
        }
        ,
        u.r = function (e) {
            "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
                value: "Module"
            }),
                Object.defineProperty(e, "__esModule", {
                    value: !0
                })
        }
        ,
        u.t = function (e, t) {
            if (1 & t && (e = u(e)),
            8 & t)
                return e;
            if (4 & t && "object" == typeof e && e && e.__esModule)
                return e;
            var n = Object.create(null);
            if (u.r(n),
                Object.defineProperty(n, "default", {
                    enumerable: !0,
                    value: e
                }),
            2 & t && "string" != typeof e)
                for (var o in e)
                    u.d(n, o, function (t) {
                        return e[t]
                    }
                        .bind(null, o));
            return n
        }
        ,
        u.n = function (e) {
            var t = e && e.__esModule ? function () {
                        return e.default
                    }
                    : function () {
                        return e
                    }
            ;
            return u.d(t, "a", t),
                t
        }
        ,
        u.o = function (e, t) {
            return Object.prototype.hasOwnProperty.call(e, t)
        }
        ,
        u.p = "https://p1.yqbimg.net/h5/bank/",
        u.oe = function (e) {
            throw e
        }
    ;
    var s = window.webpackJsonp = window.webpackJsonp || []
        , c = s.push.bind(s);
    s.push = t,
        s = s.slice();
    for (var l = 0; l < s.length; l++)
        t(s[l]);
    var d = c;
    i.push([634, 0, 1, 2, 5, 6, 9, 10, 68]),
        n()
}(
    {
        'test':function (){
            console.log('get_sign')
        }
    },
)
get_sign('test')

9、补充加载模块

image.png
image.png
去掉重复 最终扣出的模块 一共5个 后续还会有一个是生成另一个参数的 大家往后看
image.png

10、生成sign逻辑

image.png
image.png

11、reqtranceno参数的寻找

image.png
image.png
进入h.default
image.png
将这个放到加载器中直接调用获取生成的值
image.png

12、还原python逻辑

image.png
image.png
image.png

总结

这是一个webpack的经典案例,难度适中,主要是要理解webpack的流程。对应三个参数该如果获取,先后的逻辑分析清楚就会非常简单

最后

随着本篇文章的结尾,爬虫阶段就正式结束了

在此,感谢大家的支持,接下来,我会持续更新OpenCV(计算机视觉开发)或C语言基础

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1366756.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Spring——基于注解的AOP控制事务

基于注解的AOP控制事务 1.拷贝上一次代码 2.applicationContext.xml <!-- 开启spring对注解事务的支持 --> <tx:annotation-driven transaction-manager"transactionManager"/> 3.service Service Transactional(readOnlytrue,propagation Propagatio…

RT_Thread 调试笔记:时间相关,时钟管理函数,延时,定时器、 毫秒转换为时分秒 等

说明&#xff1a;记录日常使用 RT_Thread 开发时做的笔记。 持续更新中&#xff0c;欢迎收藏。 1. 延时函数 1. us延时函数 rt_hw_us_delay(rt_uint32_t us);//输如数据是us rt_hw_us_delay(200);//输入数据是us 2. ms延时函数 rt_thread_mdelay(1000);//输入数据是ms 2…

Android Matrix (二)具体图形变换参数的获取

Android Matrix &#xff08;二&#xff09;具体图形变换参数的获取 Matrix 类在 Android 中用于表示 3x3 的变换矩阵。这个矩阵可以应用于画布&#xff08;Canvas&#xff09;&#xff0c;视图&#xff08;View&#xff09;或者位图&#xff08;Bitmap&#xff09;&#xff0…

C#设计模式之单例模式

介绍 单例模式&#xff08;Singleton&#xff09;保证一个类仅有一个实例&#xff0c;并提供一个访问它的全局访问点。 单例模式的结构图如下所示&#xff1a; 使用单例模式的原因 对一些类来说&#xff0c;只有一个实例是很重要的。如何才能保证一个类只有一个实例并且这个…

【JAVA】Iterator 怎么使用?有什么特点

&#x1f34e;个人博客&#xff1a;个人主页 &#x1f3c6;个人专栏&#xff1a; JAVA ⛳️ 功不唐捐&#xff0c;玉汝于成 目录 前言 正文 Iterator 接口的主要方法&#xff1a; 例子 特点&#xff1a; 结语 我的其他博客 前言 在编程的世界里&#xff0c;迭代…

【QML COOK】- 000-创建Project

1. 文件->New Project... 2. Application(Qt)->Qt Quick Application(compat) 3. 填好【名称】和【创建路径】 4. 选择CMake 5. 选择QT6.2 6. 直接【下一步】 7. 直接下一步 8. 直接下一步 9. 出现工程文件 10. 点击运行 11. 出现窗口

npm报错error:03000086:digital envelope routines::initialization error

可能是因为node版本过高&#xff0c;与现在的项目不符合 这是降低node版本的命令&#xff0c;然后重新运行 npm install npm8.1.2 -g

张留念瞰游天下总经理与汤加政府签署合作备忘 将于2024年隆重启动

汤加是南太平洋上一个美丽的岛国&#xff0c;是南太平洋唯一维持君主立宪制的国家&#xff0c;全国由173个海岛组成&#xff0c;海洋、海岛旅游资源丰富&#xff0c;是个原生态的旅游胜地。 中汤两国建交25年以来&#xff0c;两国政府高级官员和代表团互访频繁&#xff0c;在政…

【源码预备】Calcite基础知识与概念:关系代数概念、查询优化、sql关键字执行顺序以及calcite基础概念

文章目录 一. 关系代数的基本知识二. 查询优化三. SQL语句的解析顺序1. FROM2. WHERE3. GROUP BY4. HAVING5. SELECT 四. Apache Calcite中的基本概念1. Adapter2. Calcite中的关系表达式2.1. 关系表达式例子2.2. 源码底层结构 3. Calcite的优化规则4. Calcite的Trait--算子物理…

自动挡的闪300?QJ要做第一个吃螃蟹的人了?

其实在发布会当天&#xff0c;有一台车在现场热度是比赛921还高的&#xff0c;因为四缸大跑车大家可能都见多了&#xff0c;而QJ带来一台自动挡的闪300&#xff0c;这个自动挡其实是需要加个引号的&#xff0c;因为升档的时候是需要你按一下手把上的按键的&#xff0c;有点类似…

设计模式的艺术P1基础—2.4-2.11 面向对象设计原则

设计模式的艺术P1基础—2.4-2.11 面向对象设计原则 2.4 面向对象设计原则概述 向对象设计的目标之一在于支持可维护性复用&#xff0c;一方面需要实现设计方案或者源代码的重用&#xff0c;另一方面要确保系统能够易于扩展和修改&#xff0c;具有较好的灵活性。 面向对象设计…

基于Java SSM框架实现实现机房预约系统项目【项目源码+论文说明】

基于java的SSM框架实现机房预约系统演示 摘要 21世纪的今天&#xff0c;随着社会的不断发展与进步&#xff0c;人们对于信息科学化的认识&#xff0c;已由低层次向高层次发展&#xff0c;由原来的感性认识向理性认识提高&#xff0c;管理工作的重要性已逐渐被人们所认识&#…

这款Web剪藏工具绝了,支持10+平台内容剪辑同步!

前言 Web Clipper 是一个开源项目&#xff0c;旨在帮助用户轻松地保存和组织网页内容。它可以作为浏览器插件安装到常见的浏览器中&#xff0c;如Chrome、Firefox 等&#xff0c;用户可以使用它来保存网页、截取文章、添加标签和注释等操作&#xff0c;从而方便地管理和分享自…

[VUE]4-状态管理vuex

目录 状态管理 vuex 1、vuex 介绍 2、安装 3、使用方式 4、总结 &#x1f343;作者介绍&#xff1a;双非本科大三网络工程专业在读&#xff0c;阿里云专家博主&#xff0c;专注于Java领域学习&#xff0c;擅长web应用开发、数据结构和算法&#xff0c;初步涉猎Python人工智…

20240108移远的4G模块EC20在Firefly的AIO-3399J开发板的Android11下调通的步骤

20240108移远的4G模块EC20在Firefly的AIO-3399J开发板的Android11下调通的步骤 2024/1/8 17:50 缘起&#xff1a;使用友善之臂的Android11可以让EC20上网&#xff0c;但是同样的修改步骤&#xff0c;Toybrick的Android11不能让EC20上网。最后确认是selinux的问题&#xff01; …

亲测有效:腾讯云免费服务器30天申请流程

腾讯云免费服务器申请入口 https://curl.qcloud.com/FJhqoVDP 免费服务器可选轻量应用服务器和云服务器CVM&#xff0c;轻量配置可选2核2G3M、2核8G7M和4核8G12M&#xff0c;CVM云服务器可选2核2G3M和2核4G3M配置&#xff0c;腾讯云百科txybk.com分享2024年最新腾讯云免费服务器…

nodejs 不用 electron 实现打开文件资源管理器并选择文件

前言 最近在开发一些小脚本&#xff0c;用 nodejs 实现。其中很多功能需要选择一个/多个文件&#xff0c;或者是选择一个文件夹。 最初的实现是手动输入一个目录&#xff08;这个只是一个普通的终端文本输入&#xff0c;所以按下 tab 没有路径提示&#xff09;&#xff0c;非…

用可视化案例讲Rust编程1. 怎么能学会Rust

用可视化案例讲Rust编程 1. 怎么能学会Rust 如果要列举Rust的优势&#xff0c;恐怕写个十条八条是写不完的&#xff0c;而且不管写哪条优势&#xff0c;都有很多同学跳起来反驳&#xff0c;比如我们说Rust比C/C内存安全&#xff0c;肯定有同学说C 20也支持内存安全&#xff0…

QT布局组件

时间记录&#xff1a;2024/1/8 一、整个页面各位置的详细图片 这些的布局都可以通过QSS来进行修改 二、非QSS的一些布局组件 2.1 QHBoxLayout水平布局组件 常用属性&#xff1a; &#xff08;1&#xff09;spacing&#xff1a;子组件间的间距 &#xff08;2&#xff09;st…

关于电脑屏幕亮度的调整,看这篇文章就够了

你可能需要定期更改屏幕亮度。当外面很亮的时候,你想把它调大,这样你就能看到。当你在黑暗的房间里时,你会希望它变暗,这样就不会伤害你的眼睛。降低屏幕亮度也有助于节省电力并延长笔记本电脑的电池寿命。 除了手动更改屏幕亮度外,Windows还可以通过多种方式自动更改屏幕…