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

平安银行商场实战

需求

获取该商城商品信息

目标网址

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 = uu.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.rhkb.cn/news/234195.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

系列十四、while do...while switch模板代码

一、while & do...while & switch模板代码 1.1、while /*** 需求&#xff1a;使用while循环打印5遍Hello World!*/ Test public void print5() {int i 1;while (i < 5) {System.out.println("Hello World! " LocalDateTime.now());// 线程休眠&#x…

大模型笔记【2】 LLM in Flash

Apple最近发表了一篇文章&#xff0c;可以在iphone, MAC 上运行大模型&#xff1a;【LLM in a flash: Efficient Large Language Model Inference with Limited Memory】。 主要解决的问题是在DRAM中无法存放完整的模型和计算&#xff0c;但是Flash Memory可以存放完整的模型。…

05、Kafka ------ 各个功能的作用解释(主题和分区 详解,用命令行和图形界面创建主题和查看主题)

目录 CMAK 各个功能的作用解释&#xff08;主题&#xff09;★ 主题★ 分区★ 创建主题&#xff1a;★ 列出和查看主题 CMAK 各个功能的作用解释&#xff08;主题&#xff09; ★ 主题 Kafka 主题虽然也叫 topic&#xff0c;但它和 Pub-Sub 消息模型中 topic 主题及 AMQP 的 t…

【实用技巧】Windows 电脑向iPhone或iPad传输视频方法1:无线传输

一、内容简介 本文介绍如何使用 Windows 电脑向 iPhone 或 iPad 传输视频&#xff0c;以 iPhone 为例&#xff0c;iPad的操作方法类似&#xff0c;本文不作赘述。 二、所需原材料 Windows 电脑&#xff08;桌面或其它文件夹中存有要导入的视频&#xff09;、iPhone 14。 待…

如何通过PreMaint状态监测发现设备故障:以振动监测为例

在现代工业环境中&#xff0c;设备的健康状况对于维持生产效率至关重要。计划外停机可能导致巨大的成本损失&#xff0c;因此采用先进的监测技术成为预防性维护的核心策略之一。其中&#xff0c;振动监测作为一种早期故障检测手段&#xff0c;通过PreMaint状态监测系统的引入&a…

从虚拟到现实:数字孪生驱动智慧城市可持续发展

随着科技的飞速发展&#xff0c;智慧城市已经成为未来城市发展的重要趋势。数字孪生技术作为智慧城市建设中的关键技术之一&#xff0c;正在发挥着越来越重要的作用。本文将探讨数字孪生如何从虚拟走向现实&#xff0c;驱动智慧城市的可持续发展。 一、数字孪生技术&#xff1…

解决sublime中文符号乱码问题

效果图 原来 后来 问题不是出自encode文件编码&#xff0c;而是win10的字体问题。 解决方法 配置&#xff1a; { "font_face":"Microsoft Yahei", "dpi_scale": 1.0 } 参考自 Sublime 输入中文显示方框问号乱码_sublime中文问号-CSDN博…

【开源】基于JAVA+Vue+SpringBoot的大学计算机课程管理平台

目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 实验课程档案模块2.2 实验资源模块2.3 学生实验模块 三、系统设计3.1 用例设计3.2 数据库设计3.2.1 实验课程档案表3.2.2 实验资源表3.2.3 学生实验表 四、系统展示五、核心代码5.1 一键生成实验5.2 提交实验5.3 批阅实…

系列十四、理解MySQL varchar(50)

一、理解MySQL varchar(50) 1.1、概述 日常开发中&#xff0c;数据库建表是必不可少的一个环节&#xff0c;建表的时候通常会看到设定某个字段的长度为varchar(50)&#xff0c;例如如下建表语句&#xff1a; 那么怎么理解varchar(50)&#xff1f;这个分情况的&#xff0c;MySQ…

关于“Python”的核心知识点整理大全61

目录 注意 20.1.4 使用 jumbotron 设置主页的样式 index.html 20.1.5 设置登录页面的样式 login.html 20.1.6 设置 new_topic 页面的样式 new_topic.html 20.1.7 设置 topics 页面的样式 topics.html 元素&#xff0c;让它们在页面上显得大些&#xff08;见2&#xf…

有趣的前端知识(二)

推荐阅读 智能化校园&#xff1a;深入探讨云端管理系统设计与实现&#xff08;一&#xff09; 智能化校园&#xff1a;深入探讨云端管理系统设计与实现&#xff08;二&#xff09; 文章目录 推荐阅读HTML元素元素属性头部元素列表元素区块元素表单元素 颜色字符实体 HTML元素 …

OpenHarmony之hdc

OpenHarmony之hdc 简介 hdc&#xff08;OpenHarmony Device Connector&#xff09;是 OpenHarmony 为开发人员提供的用于调试的命令行工具&#xff0c;通过该工具可以在Windows/Linux/MacOS等系统上与开发机或者模拟器进行交互。 类似于Android的adb&#xff0c;和adb类似&a…

BlogPark测试报告

目录 一&#xff0c;项目背景 二&#xff0c;项目功能 三&#xff0c;测试计划 3.1 测试用例的设计 3.2 功能测试 1.正常登录 2.正常写博客测试 &#xff08;输入完整的标题和内容&#xff09; 3.发布博客之后跳转到详情页观察是否有刚发布的博客 4.删除博客观察列表的…

Linux下从sqlite3源码编译出sqlite3库及相关可执行程序

目录 1. 下载sqlite3源码并编译 2. 下载Tcl库并编译 3. 再次编译sqlite源码 1. 下载sqlite3源码并编译 打开SQLite Download Page&#xff0c;滚动到页面的下面&#xff0c;找到源码量最大的那个&#xff08;其它的估计也行&#xff0c;但源码最大的本人感觉功能最全&#…

【unity小技巧】FPS游戏实现相机的偏移震动、武器射击后退和后坐力效果

最终效果 文章目录 最终效果前言相机偏移震动相机震动脚本换弹节点震动 武器射击后退效果武器后坐力效果完结 前言 关于后坐力之前其实已经分享了一个&#xff1a;FPS游戏后坐力制作思路 但是实现起来比较复杂&#xff0c;如果你只是想要简单的实现&#xff0c;可以看看这个&…

软件测试|Python对JSON的解析和创建详解

简介 JSON&#xff08;JavaScript Object Notation&#xff09;是一种轻量级的数据交换格式&#xff0c;已经成为当今互联网应用中广泛使用的数据格式之一。Python提供了内置的模块来解析和创建JSON数据&#xff0c;使得在Python中处理JSON变得非常简单。本文将详细介绍Python…

GB28181视频汇聚平台EasyCVR级联后,部分通道视频无法播放是什么原因?

GB28181协议智慧安防平台EasyCVR是基于各种IP流媒体协议传输的视频汇聚和融合管理平台。视频流媒体服务器EasyCVR采用了开放式的网络结构&#xff0c;支持高清视频的接入和传输、分发&#xff0c;平台提供实时远程视频监控、视频录像、录像回放与存储、告警、语音对讲、云台控制…

Python 网络爬虫的常用库汇总(建议收藏)

Python 在编写网络爬虫常常用到的一些库。 Python爬虫网络库主要包括&#xff1a;urllib、requests、lxml、fake-useragent、bs4(BeautifulSoup)、grab、pycurl、urllib3、httplib2、RoboBrowser 、MechanicalSoup、mechanize、socket、Unirest for Python、hyper、PySocks、t…

Spring MVC的RequestMapping注解、controller方法返回值

1.使用说明 作用&#xff1a;用于建立请求URL和处理请求方法之间的对应关系。 出现位置&#xff1a; 类上&#xff1a; 请求 URL的第一级访问目录。此处不写的话&#xff0c;就相当于应用的根目录。写的话需要以/开头。它出现的目的是为了使我们的 URL 可以按照模块化管理&…

Realm Management Extension领域管理扩展之安全状态

RME基于Arm TrustZone技术。TrustZone技术在Armv6中引入,提供以下两个安全状态: 安全状态(Secure state)非安全状态(Non-secure state)以下图表显示了在AArch64中的这两个安全状态以及通常在每个安全状态中找到的软件组件: 该架构将在安全状态运行的软件与在非安全状态运…