阿里房产

抓取网址:https://zc-paimai.taobao.com/wow/pm/default/pc/4b80fa?spm=a2129.27064540.puimod-zc-focus-2021_2860107850.category-1-1&pmid=4974966512_1725351051706&pmtk=20140647.0.0.0.27064540.puimod-zc-focus-2021_2860107850.category-1-1&path=27064540&page=6

抓取目标:房屋相关信息

image-20240903163039869

网页分析

打开网页后,按F12打开开发者工具,然后搜索数据,点击翻页。

image-20240903163236861

载荷有sign加密

image-20240903163320877

定位参数加密位置

image-20240903163401462

大致根据特征可以得到是md5加密

image-20240903163535810

抠代码

image-20240903163654090

这个自执行函数需要进行改动

image-20240903164149499

寻找参数

  • a
a = (new Date).getTime()
  • s
s = n.appKey || ("waptest" === o.subDomain ? "4272" : "12574478")

其实就是载荷中的appkey

image-20240903164304238

  • o.token

image-20240903164512380

其实这个值是不会变的,我们先写死,在全局进行搜索可得

image-20240903165004952

  • data

就是载荷中的表单数据

image-20240903165159819

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
function p(e) {
function t(e, t) {
return e << t | e >>> 32 - t
}

function n(e, t) {
var n, o, r, i, s;
return r = 2147483648 & e,
i = 2147483648 & t,
s = (1073741823 & e) + (1073741823 & t),
(n = 1073741824 & e) & (o = 1073741824 & t) ? 2147483648 ^ s ^ r ^ i : n | o ? 1073741824 & s ? 3221225472 ^ s ^ r ^ i : 1073741824 ^ s ^ r ^ i : s ^ r ^ i
}

function o(e, o, r, i, s, a, p) {
return e = n(e, n(n(function (e, t, n) {
return e & t | ~e & n
}(o, r, i), s), p)),
n(t(e, a), o)
}

function r(e, o, r, i, s, a, p) {
return e = n(e, n(n(function (e, t, n) {
return e & n | t & ~n
}(o, r, i), s), p)),
n(t(e, a), o)
}

function i(e, o, r, i, s, a, p) {
return e = n(e, n(n(function (e, t, n) {
return e ^ t ^ n
}(o, r, i), s), p)),
n(t(e, a), o)
}

function s(e, o, r, i, s, a, p) {
return e = n(e, n(n(function (e, t, n) {
return t ^ (e | ~n)
}(o, r, i), s), p)),
n(t(e, a), o)
}

function a(e) {
var t, n = "", o = "";
for (t = 0; 3 >= t; t++)
n += (o = "0" + (e >>> 8 * t & 255).toString(16)).substr(o.length - 2, 2);
return n
}

var p, u, c, d, l, f, m, g, y, v;
for (v = function (e) {
for (var t, n = e.length, o = n + 8, r = 16 * ((o - o % 64) / 64 + 1), i = new Array(r - 1), s = 0, a = 0; n > a;)
s = a % 4 * 8,
i[t = (a - a % 4) / 4] = i[t] | e.charCodeAt(a) << s,
a++;
return s = a % 4 * 8,
i[t = (a - a % 4) / 4] = i[t] | 128 << s,
i[r - 2] = n << 3,
i[r - 1] = n >>> 29,
i
}(e = function (e) {
e = e.replace(/\r\n/g, "\n");
for (var t = "", n = 0; n < e.length; n++) {
var o = e.charCodeAt(n);
128 > o ? t += String.fromCharCode(o) : o > 127 && 2048 > o ? (t += String.fromCharCode(o >> 6 | 192),
t += String.fromCharCode(63 & o | 128)) : (t += String.fromCharCode(o >> 12 | 224),
t += String.fromCharCode(o >> 6 & 63 | 128),
t += String.fromCharCode(63 & o | 128))
}
return t
}(e)),
f = 1732584193,
m = 4023233417,
g = 2562383102,
y = 271733878,
p = 0; p < v.length; p += 16)
u = f,
c = m,
d = g,
l = y,
f = o(f, m, g, y, v[p + 0], 7, 3614090360),
y = o(y, f, m, g, v[p + 1], 12, 3905402710),
g = o(g, y, f, m, v[p + 2], 17, 606105819),
m = o(m, g, y, f, v[p + 3], 22, 3250441966),
f = o(f, m, g, y, v[p + 4], 7, 4118548399),
y = o(y, f, m, g, v[p + 5], 12, 1200080426),
g = o(g, y, f, m, v[p + 6], 17, 2821735955),
m = o(m, g, y, f, v[p + 7], 22, 4249261313),
f = o(f, m, g, y, v[p + 8], 7, 1770035416),
y = o(y, f, m, g, v[p + 9], 12, 2336552879),
g = o(g, y, f, m, v[p + 10], 17, 4294925233),
m = o(m, g, y, f, v[p + 11], 22, 2304563134),
f = o(f, m, g, y, v[p + 12], 7, 1804603682),
y = o(y, f, m, g, v[p + 13], 12, 4254626195),
g = o(g, y, f, m, v[p + 14], 17, 2792965006),
f = r(f, m = o(m, g, y, f, v[p + 15], 22, 1236535329), g, y, v[p + 1], 5, 4129170786),
y = r(y, f, m, g, v[p + 6], 9, 3225465664),
g = r(g, y, f, m, v[p + 11], 14, 643717713),
m = r(m, g, y, f, v[p + 0], 20, 3921069994),
f = r(f, m, g, y, v[p + 5], 5, 3593408605),
y = r(y, f, m, g, v[p + 10], 9, 38016083),
g = r(g, y, f, m, v[p + 15], 14, 3634488961),
m = r(m, g, y, f, v[p + 4], 20, 3889429448),
f = r(f, m, g, y, v[p + 9], 5, 568446438),
y = r(y, f, m, g, v[p + 14], 9, 3275163606),
g = r(g, y, f, m, v[p + 3], 14, 4107603335),
m = r(m, g, y, f, v[p + 8], 20, 1163531501),
f = r(f, m, g, y, v[p + 13], 5, 2850285829),
y = r(y, f, m, g, v[p + 2], 9, 4243563512),
g = r(g, y, f, m, v[p + 7], 14, 1735328473),
f = i(f, m = r(m, g, y, f, v[p + 12], 20, 2368359562), g, y, v[p + 5], 4, 4294588738),
y = i(y, f, m, g, v[p + 8], 11, 2272392833),
g = i(g, y, f, m, v[p + 11], 16, 1839030562),
m = i(m, g, y, f, v[p + 14], 23, 4259657740),
f = i(f, m, g, y, v[p + 1], 4, 2763975236),
y = i(y, f, m, g, v[p + 4], 11, 1272893353),
g = i(g, y, f, m, v[p + 7], 16, 4139469664),
m = i(m, g, y, f, v[p + 10], 23, 3200236656),
f = i(f, m, g, y, v[p + 13], 4, 681279174),
y = i(y, f, m, g, v[p + 0], 11, 3936430074),
g = i(g, y, f, m, v[p + 3], 16, 3572445317),
m = i(m, g, y, f, v[p + 6], 23, 76029189),
f = i(f, m, g, y, v[p + 9], 4, 3654602809),
y = i(y, f, m, g, v[p + 12], 11, 3873151461),
g = i(g, y, f, m, v[p + 15], 16, 530742520),
f = s(f, m = i(m, g, y, f, v[p + 2], 23, 3299628645), g, y, v[p + 0], 6, 4096336452),
y = s(y, f, m, g, v[p + 7], 10, 1126891415),
g = s(g, y, f, m, v[p + 14], 15, 2878612391),
m = s(m, g, y, f, v[p + 5], 21, 4237533241),
f = s(f, m, g, y, v[p + 12], 6, 1700485571),
y = s(y, f, m, g, v[p + 3], 10, 2399980690),
g = s(g, y, f, m, v[p + 10], 15, 4293915773),
m = s(m, g, y, f, v[p + 1], 21, 2240044497),
f = s(f, m, g, y, v[p + 8], 6, 1873313359),
y = s(y, f, m, g, v[p + 15], 10, 4264355552),
g = s(g, y, f, m, v[p + 6], 15, 2734768916),
m = s(m, g, y, f, v[p + 13], 21, 1309151649),
f = s(f, m, g, y, v[p + 4], 6, 4149444226),
y = s(y, f, m, g, v[p + 11], 10, 3174756917),
g = s(g, y, f, m, v[p + 2], 15, 718787259),
m = s(m, g, y, f, v[p + 9], 21, 3951481745),
f = n(f, u),
m = n(m, c),
g = n(g, d),
y = n(y, l);
return (a(f) + a(m) + a(g) + a(y)).toLowerCase()
}

token = '6b15c062e7cdf09b4a732e8af15cb224'
a = (new Date).getTime()
s = 12574478
data = '{"dfApp":"auctionwalle","dfApiName":"auctionwalle.datou.getPageModulesData","dfVariables":"{\\"pageId\\":1410667,\\"moduleIds\\":\\"9018433170:items\\",\\"context\\":{\\"_b_9018433170:items\\":\\"{\\\\\\"spm\\\\\\":\\\\\\"a2129.27064540.puimod-zc-focus-2021_2860107850.category-1-1\\\\\\",\\\\\\"pmid\\\\\\":\\\\\\"4974966512_1725351051706\\\\\\",\\\\\\"pmtk\\\\\\":\\\\\\"20140647.0.0.0.27064540.puimod-zc-focus-2021_2860107850.category-1-1\\\\\\",\\\\\\"path\\\\\\":\\\\\\"27064540\\\\\\",\\\\\\"userInfo\\\\\\":{\\\\\\"userId\\\\\\":\\\\\\"2003794341\\\\\\"},\\\\\\"page\\\\\\":\\\\\\"6\\\\\\",\\\\\\"appendMap\\\\\\":{\\\\\\"sid\\\\\\":\\\\\\"5091490057_1725351075707\\\\\\"}}\\",\\"userInfo\\":\\"{}\\",\\"device\\":\\"pc\\",\\"sceneCode\\":\\"20200713C5R32B6N\\"}}","dfUniqueId":"1410667.9018433170:items","dfVariablesRecover":"{}"}'

console.log(p(token + "&" + a + "&" + s + "&" + data))
  • python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import time

import requests
import execjs

cookies = {
'cna': 'CX/0HulERjACAXkjZLQUrotW',
'hng': 'CN%7Czh-CN%7CCNY%7C156',
'_uetvid': '111ec7202b1b11ef9a492342900bfc17',
'thw': 'cn',
'tracknick': 'tb35987068',
'havana_lgc2_0': 'eyJoaWQiOjIwMDM3OTQzNDEsInNnIjoiNWY5YTczNDg5Y2M3ZDRiYWNlYjg4ZGNiNDE3MGMwYzEiLCJzaXRlIjowLCJ0b2tlbiI6IjFrc1pyVlhSRjJodWRJbGVpM3RKanp3In0',
'_hvn_lgc_': '0',
'wk_cookie2': '11a06b099c8334dd1274b9833a29abde',
'wk_unb': 'UUjRIb%2BRjfXy3g%3D%3D',
'useNativeIM': 'false',
'sn': '',
'lgc': 'tb35987068',
't': '48abf2ad6e8cff7ef43818e5805801cd',
'cancelledSubSites': 'empty',
'dnk': 'tb35987068',
'cookie2': '19356d370f3d7d26f6ce7bc8790e4131',
'_tb_token_': 'ee65ede36f755',
'_samesite_flag_': 'true',
'3PcFlag': '1725323187067',
'xlly_s': '1',
'mtop_partitioned_detect': '1',
'_m_h5_tk': '6b15c062e7cdf09b4a732e8af15cb224_1725361462969',
'_m_h5_tk_enc': '65240e71484cece8cc1b21c8925df0aa',
'sgcookie': 'E100a4dKFEsNCiQOrVllZc6uLMzmDw5wfOQW2WlgPF7ChvwBMycMIvKiwm7MJ2N9WOrTVT0TBnL%2B7JA%2FZu2ynccyqgKXVwRWVNqWnYaKdYjvHGH8YjcnQbviAliPrBaebZHT',
'havana_lgc_exp': '1756455023810',
'unb': '2003794341',
'uc1': 'pas=0&existShop=false&cookie14=UoYcBh0HWRw0zQ%3D%3D&cookie16=UtASsssmPlP%2Ff1IHDsDaPRu%2BPw%3D%3D&cookie21=UIHiLt3xThH8t7YQoFNq&cookie15=UIHiLt3xD8xYTw%3D%3D',
'uc3': 'nk2=F5RGM4nN%2F3eKwg%3D%3D&vt3=F8dD3isMuxMdRKuxn5c%3D&id2=UUjRIb%2BRjfXy3g%3D%3D&lg2=VFC%2FuZ9ayeYq2g%3D%3D',
'csg': '7dab3463',
'cookie17': 'UUjRIb%2BRjfXy3g%3D%3D',
'skt': '20c19402f0a2ebd4',
'existShop': 'MTcyNTM1MTAyMw%3D%3D',
'uc4': 'id4=0%40U2ozlu98sp9Pv%2Bwx4miEQDtz2YBg&nk4=0%40FY4NBmsLbwJ%2BfuFaCEctxWKmMAOk',
'_cc_': 'VFC%2FuZ9ajQ%3D%3D',
'_l_g_': 'Ug%3D%3D',
'sg': '81b',
'_nk_': 'tb35987068',
'cookie1': 'U7f2lqdlPB%2Fp3JJb11snyODQOqKQNfbrQZbxM1OPCqE%3D',
'sdkSilent': '1725437423814',
'havana_sdkSilent': '1725437423814',
'tfstk': 'fIMIxlxMRwbBA3x9VaKa1oeKLZ27N494vgZ-m0BF2JepwzaZ2HmEYBvS1m0783A3LfaSWVad8JWE503aSYleqBXJVm4gzvyLy7sTqq-nP0x32z3-Pzle_Konx82Juz923D0JdEgZRuELX3E7D9h4JClox82J7GWJgKinlsoMKbeJfRE74we826F9fuZby8ULwNCTDPe8y4FRXPEumkCLy6Q9fu4T28FL9GH6xiZWOymBXmJqw1T1Aua1ets0YWCIq_Wcnpr39rF9kt6XZkNQkDU6u0pB45nuNYjlF7mKi4qxJwL4t0hs5kwWQ6exfb3bjvpVRlcEXmztcgWrcJMsCbF6vpn_dyNbf5sA1JG--YNnOgxmXJ3iirVpsFqsLxP7o5_9Jco_JSGS8FX88jit5SkN7tyoSb38VVQC4IB4lKKONGNcFla2fh1lZuVkEN_7x9h09lqQ_ht1JbVLjla2fh1lZWEgAo-6fwhl.',
'isg': 'BMHBMwXOQ8YGSa9JAs45sdZY0A3b7jXgdE5nPyMTQE3XCubcaDzLsBxM7H5MAs0Y',
}

headers = {
'accept': 'application/json',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/x-www-form-urlencoded',
# 'cookie': 'cna=CX/0HulERjACAXkjZLQUrotW; hng=CN%7Czh-CN%7CCNY%7C156; _uetvid=111ec7202b1b11ef9a492342900bfc17; thw=cn; tracknick=tb35987068; havana_lgc2_0=eyJoaWQiOjIwMDM3OTQzNDEsInNnIjoiNWY5YTczNDg5Y2M3ZDRiYWNlYjg4ZGNiNDE3MGMwYzEiLCJzaXRlIjowLCJ0b2tlbiI6IjFrc1pyVlhSRjJodWRJbGVpM3RKanp3In0; _hvn_lgc_=0; wk_cookie2=11a06b099c8334dd1274b9833a29abde; wk_unb=UUjRIb%2BRjfXy3g%3D%3D; useNativeIM=false; sn=; lgc=tb35987068; t=48abf2ad6e8cff7ef43818e5805801cd; cancelledSubSites=empty; dnk=tb35987068; cookie2=19356d370f3d7d26f6ce7bc8790e4131; _tb_token_=ee65ede36f755; _samesite_flag_=true; 3PcFlag=1725323187067; xlly_s=1; mtop_partitioned_detect=1; _m_h5_tk=6b15c062e7cdf09b4a732e8af15cb224_1725361462969; _m_h5_tk_enc=65240e71484cece8cc1b21c8925df0aa; sgcookie=E100a4dKFEsNCiQOrVllZc6uLMzmDw5wfOQW2WlgPF7ChvwBMycMIvKiwm7MJ2N9WOrTVT0TBnL%2B7JA%2FZu2ynccyqgKXVwRWVNqWnYaKdYjvHGH8YjcnQbviAliPrBaebZHT; havana_lgc_exp=1756455023810; unb=2003794341; uc1=pas=0&existShop=false&cookie14=UoYcBh0HWRw0zQ%3D%3D&cookie16=UtASsssmPlP%2Ff1IHDsDaPRu%2BPw%3D%3D&cookie21=UIHiLt3xThH8t7YQoFNq&cookie15=UIHiLt3xD8xYTw%3D%3D; uc3=nk2=F5RGM4nN%2F3eKwg%3D%3D&vt3=F8dD3isMuxMdRKuxn5c%3D&id2=UUjRIb%2BRjfXy3g%3D%3D&lg2=VFC%2FuZ9ayeYq2g%3D%3D; csg=7dab3463; cookie17=UUjRIb%2BRjfXy3g%3D%3D; skt=20c19402f0a2ebd4; existShop=MTcyNTM1MTAyMw%3D%3D; uc4=id4=0%40U2ozlu98sp9Pv%2Bwx4miEQDtz2YBg&nk4=0%40FY4NBmsLbwJ%2BfuFaCEctxWKmMAOk; _cc_=VFC%2FuZ9ajQ%3D%3D; _l_g_=Ug%3D%3D; sg=81b; _nk_=tb35987068; cookie1=U7f2lqdlPB%2Fp3JJb11snyODQOqKQNfbrQZbxM1OPCqE%3D; sdkSilent=1725437423814; havana_sdkSilent=1725437423814; tfstk=fIMIxlxMRwbBA3x9VaKa1oeKLZ27N494vgZ-m0BF2JepwzaZ2HmEYBvS1m0783A3LfaSWVad8JWE503aSYleqBXJVm4gzvyLy7sTqq-nP0x32z3-Pzle_Konx82Juz923D0JdEgZRuELX3E7D9h4JClox82J7GWJgKinlsoMKbeJfRE74we826F9fuZby8ULwNCTDPe8y4FRXPEumkCLy6Q9fu4T28FL9GH6xiZWOymBXmJqw1T1Aua1ets0YWCIq_Wcnpr39rF9kt6XZkNQkDU6u0pB45nuNYjlF7mKi4qxJwL4t0hs5kwWQ6exfb3bjvpVRlcEXmztcgWrcJMsCbF6vpn_dyNbf5sA1JG--YNnOgxmXJ3iirVpsFqsLxP7o5_9Jco_JSGS8FX88jit5SkN7tyoSb38VVQC4IB4lKKONGNcFla2fh1lZuVkEN_7x9h09lqQ_ht1JbVLjla2fh1lZWEgAo-6fwhl.; isg=BMHBMwXOQ8YGSa9JAs45sdZY0A3b7jXgdE5nPyMTQE3XCubcaDzLsBxM7H5MAs0Y',
'origin': 'https://zc-paimai.taobao.com',
'pragma': 'no-cache',
'priority': 'u=1, i',
'referer': 'https://zc-paimai.taobao.com/',
'sec-ch-ua': '"Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-site',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
}

page = str(5)
data = {
'data': '{"dfApp":"auctionwalle","dfApiName":"auctionwalle.datou.getPageModulesData","dfVariables":"{\\"pageId\\":1410667,\\"moduleIds\\":\\"9018433170:items\\",\\"context\\":{\\"_b_9018433170:items\\":\\"{\\\\\\"spm\\\\\\":\\\\\\"a2129.27064540.puimod-zc-focus-2021_2860107850.category-1-1\\\\\\",\\\\\\"pmid\\\\\\":\\\\\\"4974966512_1725351051706\\\\\\",\\\\\\"pmtk\\\\\\":\\\\\\"20140647.0.0.0.27064540.puimod-zc-focus-2021_2860107850.category-1-1\\\\\\",\\\\\\"path\\\\\\":\\\\\\"27064540\\\\\\",\\\\\\"userInfo\\\\\\":{\\\\\\"userId\\\\\\":\\\\\\"2003794341\\\\\\"},\\\\\\"page\\\\\\":\\\\\\"'+ page +'\\\\\\",\\\\\\"appendMap\\\\\\":{\\\\\\"sid\\\\\\":\\\\\\"5091490057_1725351075707\\\\\\"}}\\",\\"userInfo\\":\\"{}\\",\\"device\\":\\"pc\\",\\"sceneCode\\":\\"20200713C5R32B6N\\"}}","dfUniqueId":"1410667.9018433170:items","dfVariablesRecover":"{}"}',
}

token = '6b15c062e7cdf09b4a732e8af15cb224'
a = str(round(time.time() * 1000))
s = str(12574478)
_data = data['data']


t = execjs.compile(open('./demo.js',"r",encoding='utf-8').read()).call('p',token + "&" + a + "&" + s + "&" + _data)

params = {
'jsv': '2.6.1',
'appKey': s,
't': a,
'sign': t,
'bxPageId': '1410667',
'api': 'mtop.taobao.datafront.invoke.auctionwalle',
'v': '1.0',
'type': 'originaljson',
'dataType': 'json',
'requiredParams': 'dfApiName,dfUniqueId',
}


proxies = {
'http': '127.0.0.1:10792',
'https': '127.0.0.1:10792'
}

response = requests.post(
'https://h5api.m.taobao.com/h5/mtop.taobao.datafront.invoke.auctionwalle/1.0/',
params=params,
cookies=cookies,
headers=headers,
data=data,
proxies=proxies
).json()

print(response)

结果

image-20240903170607332

image-20240903170552195