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

平安银行商场实战

需求

获取该商城商品信息

目标网址

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语言基础

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

上海亚商投顾:沪指再度失守2900点 全市场超4800只个股下跌

上海亚商投顾前言&#xff1a;无惧大盘涨跌&#xff0c;解密龙虎榜资金&#xff0c;跟踪一线游资和机构资金动向&#xff0c;识别短期热点和强势个股。 一.市场情绪 三大指数昨日继续调整&#xff0c;沪指跌超1%再度失守2900点&#xff0c;深成指、创业板指均创出调整新低&…

【算法练习】leetcode算法题合集之二叉树篇

递归遍历基础篇 前序遍历&#xff0c;中序遍历&#xff0c;后序遍历是根据处理根节点的位置来命名的。 树的处理大多用到了递归&#xff0c;递归需要知道终止条件。 前序遍历&#xff08;中左右&#xff09; 144.二叉树的前序遍历 中左右&#xff0c;先处理根节点&#xff0c;…

ASP .net core微服务实战

>>>>>>>>>>>>>>开发<<<<<<<<<<<<<<<< 0)用户 用户到nginx之间需要用https&#xff0c;避免被监听。 1)nginx // 做统一的分发&#xff0c;到微服务&#xff0c;相当于网关,提供统…

异常处理:全面覆盖与精细化管理的平衡

异常处理&#xff1a;全面覆盖与精细化管理的平衡 在软件开发中&#xff0c;异常处理是保证系统稳定性和用户体验的重要环节。对于是否应当全面覆盖所有异常并设立兜底机制&#xff0c;业界存在着两种主流思路&#xff1a;全面覆盖原则和精细化处理。如何在这两者间取得平衡&a…

Unity文字转语音(使用RT-Voice PRO [2023.1.0])

参考文章Unity插件——文字转朗读语音RtVioce插件功能/用法/下载_rtvoice-CSDN博客 一、使用步骤 1.导入进Unity&#xff08;插件形式为 .unitypackage&#xff09; https://download.csdn.net/download/luckydog1120446388/88717512 2.添加所需Prefab 1&#xff09;.右键可…

【科技素养题】少儿编程 蓝桥杯青少组科技素养题真题及解析第22套

少儿编程 蓝桥杯青少组科技素养题真题及解析第22套 1、植物的叶子多为绿色,这主要是因为它们含有 A、绿色色素 B、叶绿素 C、花青素 D、细胞 答案:B 考点分析:主要考查小朋友们生物知识的储备;叶绿素是植物叶子中的一种色素,它可以吸收太阳光中的能量并转化为植物所…

【深度学习:Domain Adversarial Neural Networks (DANN) 】领域对抗神经网络简介

【深度学习&#xff1a;Domain Adversarial Neural Networks】领域对抗神经网络简介 前言领域对抗神经网络DANN 模型架构DANN 训练流程DANN示例 GPT示例 前言 领域适应&#xff08;DA&#xff09;指的是当不同数据集的输入分布发生变化&#xff08;这种变化通常被称为共变量变…

synchronized和lock的区别

synchronized和lock的区别 1&#xff09;synchronized是一个关键字&#xff0c;lock是一个java类&#xff1b; 2&#xff09;synchronized无法判断获取锁的状态&#xff0c;lock可以判断是否获取到了锁&#xff1b; 3&#xff09;synchronized会自动释放锁&#xff0c;lock必须…

《罗素论教育》笔记

目录 全书架构 书简介 经典摘录 一、教育的理想 教育的基本原理 教育的目的 二、品性的教育 一岁前的教育 主要是2岁到6岁的教育 三、智力教育 14岁前的课程安排 最后的学年 大学教育 四、结束语 全书架构 书简介 经典摘录 一、教育的理想 教育的基本原理 1、我…

Python从入门到网络爬虫(读写Excel详解)

前言 Python操作Excel的模块有很多&#xff0c;并且各有优劣&#xff0c;不同模块支持的操作和文件类型也有不同。最常用的Excel处理库有xlrd、xlwt、xlutils、xlwings、openpyxl、pandas&#xff0c;下面是各个模块的支持情况&#xff1a; 工具名称.xls.xlsx获取文件内容写入…

LitJson-Json字符串转对像时:整型与字符串或字符串转:整型进的类型不一致的处理

目录 问题描述上代码测试代码各位看官&#xff0c;打赏个1元吧 Json数据格式是大家在游戏开中常量用的一种数据格式&#xff0c;某种程度上可以说是必备的。对unity开发来说&#xff0c;LitJson这个json库应该是被使用最多的json库了。 问题描述 今天说要的其中的这个api: Jso…

2024年中国电子学会青少年编程等级考试安排的通知

各有关单位、全体考生: 中国电子学会青少年等级考试&#xff08;以下简称等级考试&#xff09;是中国电子学会为落实《全民科学素质行动规划纲要》&#xff0c;提升青少年电子信息科学素质水平而开展的社会化评价项目。等级考试自2011年启动以来&#xff0c;作为中国电子学会科…

AGV用120°激光扫描避障雷达传感器DE系列功能与通道切换操作说明

AGV用120激光扫描避障雷达传感器DE系列&#xff0c;包含DE-4211、DE-4611、DE-4311、DE-4511等型号&#xff0c;可帮助AGV/AMR/机器人快速精准地检测障碍物&#xff0c;确保系统运行安全&#xff0c;帮助智能停车系统完成准确的数据判定&#xff0c;实现车位或充电桩占用检测等…

Linux 期末复习

Linux 期末复习 计算机历史 硬件基础 1&#xff0c;计算机硬件的五大部件&#xff1a;控制器、运算器、存储器、输入输出设备 2&#xff0c;cpu分为精简指令集(RISC)和复杂指令集(CISC) 3&#xff0c;硬件只认识0和1&#xff0c;最小单位是bit&#xff0c;最小存储单位是字…

【设计模式】一文理解记住设计模式的原则

目录——阅读所需预计5-10分钟 &#x1f396;️前言&#x1f3af;单一职责原则&#x1f4e3;1. 定义&#x1f49e;2. 定义很抽象&#xff0c;咱继续看&#x1f389;3. 举几个栗子&#x1f49e;4. 以上栗子出现了一个问题&#xff0c;单一职责的划分究竟可以分多细&#x1f449;…

掌握Lazada API接口:开启电商开发新篇章,引领业务增长潮流

一、概述 Lazada API接口是Lazada平台提供的软件开发工具包&#xff0c;它允许第三方开发者通过编程方式访问Lazada平台上的商品、订单、用户等数据&#xff0c;并执行相关操作。通过使用Lazada API接口&#xff0c;开发者可以快速构建与Lazada平台集成的应用程序&#xff0c;…

Ubuntu 18.04.5 LTS 解决安装包复杂依赖相关问题解决的主要法则和VIM的安装实录

前言&#xff1a;目标和环境 环境&#xff1a; Ubuntu 18.04.5 LTSVMware 目标&#xff1a; 安装vim&#xff0c;解决包依赖的冲突&#xff1a; 本文&#xff0c;通过一个很好的实例&#xff0c;诠释了&#xff0c;LINUX系统下&#xff0c;安装一个应用遇到的依赖库问题如何…

单片机原理及应用:中断系统结构与控制寄存器

大家好啊&#xff0c;这几天因为考试断更了一段时间&#xff0c;现在放假了也可以恢复正常的更新速度了。今天我们来认识一下单片机的中断系统&#xff0c;这里可以说是我们学习单片机以来第一个核心功能&#xff0c;我们会分几期内容来深入了解中断系统的作用原理和应用方式。…

【K8S 云原生】Kurbernets集群的调度策略

目录 一、Kubernetes的list-watch机制 1、List-watch 2、创建pod的过程&#xff1a; 二、scheduler调度的过程和策略&#xff1a; 1、简介 2、预算策略&#xff1a;predicate 3、优先策略&#xff1a; 3.1、leastrequestedpriority&#xff1a; 3.2、balanceresourceal…

linux 系统安全及应用

一、账号安全基本措施 1.系统账号清理 1.将用户设置为无法登录 /sbin/nologin shell——/sbin/nologin却比较特殊&#xff0c;所谓“无法登陆”指的仅是这个用户无法使用bash或其他shell来登陆系统而已&#xff0c;并不是说这个账号就无法使用系统资源。举例来说&#xff0c;…