当前位置:网站首页>获取马蜂窝酒店数据
获取马蜂窝酒店数据
2022-07-25 23:32:00 【tslilove】
声明
本文章中所有内容仅供学习交流,抓包内容、敏感网址、数据接口均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关,若有侵权,请联系我立即删除!
主页:aHR0cHM6Ly93d3cubWFmZW5nd28uY24v
接口:aHR0cHM6Ly93d3cubWFmZW5nd28uY24vaG90ZWwvYWpheC5waHA=
抓取需求如下图框选部分

进入到主页以后,我们点击相应的酒店,筛选相应的入住日期和离开时间,点击搜索,通过抓包,找到接口

我们发现返回的数据是标准的JSON数据,而我们需要的信息就在key为html的值里面
接着我们看看请求参数是哪些,图中框选的为我们需要填的,入住和离开日期可固定,页数可以设定,时间戳可以设定,现在我们看看这个_sn参数是啥

简单粗暴的方式就是通过全局搜索大法,从图中看到,为啥没有搜索到呢?难到网页上都没有么

原因可归为以下几点:
①这个值可能在送是时候被修改 ②可能是通过混淆的代码产生,然后在发生请求的时候,调用拼接得到
那怎么办呢?
只能通过XHR断点来看了,复制接口到如下图地方,然后点击下一页,然后下一步到ajax的地方


从控制台打印一下,发生值已经生成

这个时候得网上回溯,看看d在哪儿被赋值的

然后会走到一个index的文件

可以发现,_ts和_sn参数正是有此处计算得到


_ts是时间戳,而_sn是通过请求参数,通过排序,加盐,最后通过md5加密截取2到12位得到
理解了整个脉络,可以将全部js拿下,补一下环境调用,也可以利用Python复写
这里我通过python复写,然后发起请求,获取前两页

成功获取!!!
总结:爬取过程中可能会遇到验证码,可以通过ddddocr解决

边栏推荐
猜你喜欢

The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet

Idea sets get and set templates to solve the naming problem of boolean type fields

S4/HANA MM & SD EDI基于NAST的集成配置(ORDERS, ORDRSP, DESADV, INVOIC)

学习探索-波浪

Discuz atmosphere game style template / imitation lol hero League game DZ game template GBK

File contains vulnerability

Graph traversal DFS, BFS (code explanation)

S4/HANA ME21N创建PO 输出控制消息按钮丢失解决方法(切换EDI 输出模式BRF+至NAST模式)

serialization and deserialization

意向不到的Dubug妙招
随机推荐
ES6 syntax (difference between let, const, VaR, deconstruction assignment, arrow function, residual parameters, extension method of array)
What is the difference between hot deployment and hot loading?
MVVM model
serialization and deserialization
Three board axe! Help you become an excellent software engineer
Mongodb update operator (modifier)
Moment.js
Rendering, filtering (filtering) and sorting of lists
Canada EE channel
Kotlin 常用知识点汇总
About the foundation of fetch
SAP Message No. VG202 IDoc E1EDK18 中付款条款已经转移:检查数据
Implementation of date class
【微信小程序】页面导航
This point inside the function / change this point inside the function
在应用中使用 Jetpack 库
WebMvcConfigurationSupport
Promise asynchronous callback function
策略模式_
MES系统设备管理概述(下)