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

平安银行商场实战

需求

获取该商城商品信息

目标网址

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.mzph.cn/news/606999.shtml

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

相关文章

图像融合论文阅读:CrossFuse: 一种基于交叉注意机制的红外与可见光图像融合方法

article{li2024crossfuse, title{CrossFuse: A novel cross attention mechanism based infrared and visible image fusion approach}, author{Li, Hui and Wu, Xiao-Jun}, journal{Information Fusion}, volume{103}, pages{102147}, year{2024}, publisher{Elsevier} } 论文…

当试图回复传入消息时,消息应用程序会闪烁

问题描述&#xff1a; Actual Results: Unable to reply for incoming message as Messaging app flickers and closes. Expected Results: User should be able to send reply for incoming messages. Reproduction Steps: Stay in home screen. Receive an incoming mes…

如何在 Ubuntu 20.04 上安装和使用 Docker

前些天发现了一个人工智能学习网站&#xff0c;通俗易懂&#xff0c;风趣幽默&#xff0c;最重要的屌图甚多&#xff0c;忍不住分享一下给大家。点击跳转到网站。 如何在 Ubuntu 20.04 上安装和使用 Docker 介绍 Docker是一个可以简化容器中应用程序进程管理过程的应用程序。…

拦截器HandlerInterceptor | springmvc系列

拦截器&#xff0c;通俗来来将&#xff0c;就是我们将访问某个路径的请求给拦截下来&#xff0c;然后可以对这个请求做一些操作 基本使用 创建拦截器类 让类实现HandlerInterceptor接口&#xff0c;重写接口中的三个方法。 Component //定义拦截器类&#xff0c;实现Handle…

Python实现PowerPoint(PPT/PPTX)到PDF的批量转换

演示文稿是一种常见传达信息、展示观点和分享内容的形式&#xff0c;特别是PowerPoint演示文稿&#xff0c;广泛应用于各行各业&#xff0c;几乎是演讲等场合的必备工具。然而&#xff0c;演示文稿也有其限制&#xff0c;对设备的要求较高&#xff0c;且使用不同的软件或设备演…

Ubuntu下AI4Green开源ELN服务的简单部署

主部署程序&#xff1a;AI4Green 配置参考这篇文档&#xff1a;AI4Green开源ELN&#xff08;电子实验记录本&#xff09;-CSDN博客 流量转发和负载均衡&#xff1a;使用Nginx 配置参考这篇文档&#xff1a;Nginx负载均衡-CSDN博客 SSL配置部分参考这篇文档&#xff1a; 设置…

SpringBoot-开启Actuator监控

Spring Boot Actuator是Spring Boot提供的一种管理和监控应用程序的框架&#xff0c;可以帮助我们了解应用程序的运行状况&#xff0c;提供HTTP端点来暴露应用程序的不同方面&#xff0c;如健康状况、指标、日志和运行时信息等。 开启Actuator监控&#xff0c;我们可以通过HTT…

Hyperledger Fabric 核心概念与组件

要理解超级账本 Fabric 的设计&#xff0c;首先要掌握其最基本的核心概念与组件&#xff0c;如节点、交易、排序、共识、通道等。 弄清楚这些核心组件的功能&#xff0c;就可以准确把握 Fabric 的底层运行原理&#xff0c;深入理解其在架构上的设计初衷。知其然&#xff0c;进…

回顾2023编程之旅

一、前言 看在给了我一个博客专家的份上就继续写写博客&#xff0c;实事求是的讲如果是工作之余去总结csdn写写技术博客&#xff0c;还想混个专家什么的&#xff0c;真的是精力不够。因为里面的灌水的实在太多&#xff0c;比不过的&#xff0c;写这个玩意必须得淡泊名利才能悠然…

部署一款开源的交互审计系统—Next Terminal

博客地址 部署一款开源的交互审计系统—Next Terminal-雪饼 (xue6ing.cn)https://xue6ing.cn/archives/bu-shu-yi-kuan-kai-yuan-de-jiao-hu-shen-ji-xi-tong--next-terminal Next Terminal是什么&#xff1f; Next Terminal是一个开源的交互审计系统&#xff0c;具有以下主…

控制台console

js控制台打印 console.log()和console.group() console.group()指的是消息组的开始&#xff0c;在此之后的所有消息将写进该消息组中&#xff0c; console.groupEnd()指的是该消息组的结束&#xff0c;

SpringBoot请求参数加密、响应参数解密

SpringBoot请求参数加密、响应参数解密 1.说明 在项目开发工程中&#xff0c;有的项目可能对参数安全要求比较高&#xff0c;在整个http数据传输的过程中都需要对请求参数、响应参数进行加密&#xff0c;也就是说整个请求响应的过程都是加密处理的&#xff0c;不在浏览器上暴…

40道java集合面试题含答案(很全)

点击下载《40道java集合面试题含答案&#xff08;很全&#xff09;》 1. 什么是集合 集合就是一个放数据的容器&#xff0c;准确的说是放数据对象引用的容器集合类存放的都是对象的引用&#xff0c;而不是对象的本身集合类型主要有3种&#xff1a;set(集&#xff09;、list(列…

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;.右键可…

后端 API 接口文档 Swagger 使用

Swagger 是什么 swagger是一款可以根据 restful 风格生成的接口开发文档&#xff0c;并且支持做测试的一款中间软件。 例如当我们在开发前后端分离项目时&#xff0c;当后端开发完一个功能想要测试时&#xff0c;若此时还没有相应的前端页面发起请求&#xff0c;可以通过 swag…

python炒股自动化(0),申请券商API接口

上次发了量化交易接口的区别&#xff0c;发现很多人根本不知道券商提供的API交易接口&#xff0c;这里补充一篇&#xff0c;关于券商接口的介绍。 现在市面上可以给个人账户接入的股票交易接口&#xff0c;用的最多的也就是QMT和Ptrade&#xff0c;以前接入量化交易需要机构或…

高压放大器设计要求是什么

高压放大器在科学研究和工程应用中扮演着至关重要的角色&#xff0c;特别是在需要处理高电压信号的实验和应用中。高压放大器设计要求的充分考虑至关重要&#xff0c;以确保其在各种环境中稳定、可靠地工作。下面将介绍设计高压放大器时需要考虑的关键要求和因素。 1.电压范围 …

赋能软件开发:生成式AI在优化编程工作流中的应用与前景

随着人工智能&#xff08;AI&#xff09;技术的快速发展&#xff0c;特别是生成式AI模型如GPT-3/4的出现&#xff0c;软件开发行业正经历一场变革&#xff0c;这些模型通过提供代码生成、自动化测试和错误检测等功能&#xff0c;极大地提高了开发效率和软件质量。 本文旨在深入…

Android readelf 工具查找函数符号

ELF&#xff08;Executable and Linkable Format&#xff09;是一种执行文件和可链接文件的格式。它是一种通用的二进制文件格式&#xff0c;用于在各种操作系统中存储可执行程序、共享库和内核模块。 Android 开发当中的 so 库本质上就是一种特殊类型的 ELF 文件&#xff0c;…

文章解读与仿真程序复现思路——电工技术学报EI\CSCD\北大核心《考虑灵活性补偿的高比例风电与多元灵活性资源博弈优化调度》

本专栏栏目提供文章与程序复现思路&#xff0c;具体已有的论文与论文源程序可翻阅本博主免费的专栏栏目《论文与完整程序》 这个标题涉及到高比例风电与多元灵活性资源在博弈优化调度中考虑灵活性补偿的问题。以下是对标题各个部分的解读&#xff1a; 高比例风电&#xff1a; …