Fork me on GitHub

网易手机壁纸小偷程序

四个月前发在落伍申请,居然被列入精华贴

该脚本已经弄到9千多套图片,并切成15种尺寸

240x320||176x220||176x180||144x176||132x160||128x160||128x146||128x128||128x96||120x160||120x144||120x128||120x101||96x113||80x80

只发在这里和落伍,转载的同志请保持完整哈

想知道WebSpider2是虾米东西,点击这里

oBlog居然不能发这么长的代码,那就贴壁纸的采集好了,完整的包括动画的采集请看论坛

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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
'网易手机壁纸小偷程序 
'For WebSpider2
'改版本将下载最大尺寸图片,按照不同尺寸分目录保存
'Blue Art Studio 梦游的猫
'创建日期 2005-8-10
'最后修改 2005年10月28日 15:25:55

'http://mms.163.com/new_web/cm_lv2.jsp?type=0
'http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=14
'http://mmsimg.163.com/new_web/loaditem.jsp/type=1/path=/jrzh/gj/1_050815105637_718/128x128.gif

Sub Main

'彩图 http://mms.163.com/new_web/cm_lv2.jsp?type=0
picAllName = "灌篮高手||绝色美女||姿态撩人||手绘美女||制服诱惑||封面女郎||卡通美媚||真人美女秀||港台偶像||韩日红人馆||国内大腕||欧美明星||Q版明星||男欢女爱||两小无猜||爱情祝福||整蛊专家||搞怪BB||动物也疯狂||Q版卡通||手绘卡通||小美小美||家有贱狗||乱马1/2||火影忍者||圣斗士||暴暴牛||思思狗||绿豆蛙||水果部落||猪朋狗友||刀刀的世界||日本漫画系列||香港漫画系列||真情问候||生日祝福||春节||圣诞节||情人节||中秋节||元宵节||万圣节||劳动节||母亲节||端午节||绝色风光||四季花语||海底世界||手绘之美||校园风光||可爱宠物||奇趣动物||极品靓车||极速摩托||绿茵盛事||篮球风云||精彩瞬间||体坛明星||梦幻西游||大话西游||游戏精选||星球大战||偶像剧场||影视海报||广告精选||星座生肖||秀色可餐||时尚精品||水墨彩绘||纸醉金迷||怀旧情怀||地下铁||月亮忘记了||布瓜的世界||你们我们他们||听几米唱歌||我只能为你画一张小卡片||幸运儿||森林唱游||美食天堂||时尚精品||精品家居||另类一族||纸醉金迷||休闲生活||艺术名画||国画精粹||怀旧情怀||主题世界||枪林弹雨||武装天地||绚彩图片"
picAllUrl = "http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=217||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=34||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=201||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=33||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=35||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=36||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=37||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=198||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=39||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=104||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=40||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=43||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=222||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=119||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=120||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=60||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=94||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=93||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=110||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=112||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=152||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=62||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=63||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=111||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=181||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=182||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=202||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=221||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=151||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=240||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=121||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=179||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=65||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=166||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=175||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=59||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=50||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=58||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=52||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=57||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=51||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=54||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=183||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=189||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=195||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=90||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=91||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=89||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=200||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=92||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=87||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=88||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=97||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=108||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=99||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=100||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=102||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=246||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=75||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=76||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=78||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=85||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=149||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=84||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=86||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=146||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=248||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=249||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=251||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=250||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=252||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=107||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=160||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=161||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=170||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=171||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=172||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=173||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=190||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=44||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=45||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=46||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=48||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=136||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=150||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=80||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=81||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=82||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=83||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=95||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=96||http://mms.163.c
om/new_web/cm_lv2_pic.jsp?type=0&catID=123"

'动画 http://mms.163.com/new_web/cm_lv2.jsp?type=1
'picAllName = "美女工场||美女表情||刀刀专栏||港台明星||日韩明星||欧美明星||鬼马明星秀||日常祝福||生日祝福||新婚喜庆||财源滚滚||春节||元宵节||情人节||妇女节||愚人节||母亲节||五一节||六一节||万圣节||中秋节||国庆节||圣诞节||七月十四||七夕节||父亲节||元旦||3.15消费权益保护日||搞怪语音贺卡||端午节||七一建党节||浓情蜜意||真情告白||美丽心情||小美系列||恋爱物语||灌篮高手||火影忍者||新世纪福音战士EVA||乱马二分之一||冒泡的天然画板||哆啦A梦||相聚一刻||家有贱狗||水果部落||暴暴牛||猪高乐翻天||韩国漫画精选||手机月历||来电显示||关机画面||文字秀||屏幕保护||星座生肖||开机画面||童话世界||文传漫画系列||功夫秘诀||KAK方块猪||友情万岁||约会娱乐||晚安道别||动感汽车||动感车徽||超炫体育||体坛明星||幽默男女||搞笑泡泡系列||搞怪宝贝||街头搞笑文化||爆笑SHOW||海底世界||恋恋风景||花花世界||时尚美女||古典美女||清纯可人||大话西游||梦幻西游||可爱宠物||宠物情缘||奇趣动物||猫言狗语||动画世界||你们我们他们||地下铁||向左走向右走||布瓜的世界||我只能为你画一张小卡片||我的心中每天开一朵花||月亮忘记了||森林唱游||森林里的秘密||照相本子||几米圣诞||几米新年||黑白异境||履历表||微笑的鱼||幸运儿||遗失了一只猫||123木头人||星球大战||韩日作品||掌上mtv||绿豆蛙LEON||星座物语||3D美女||嘟嘟与乐乐"
'picAllUrl = "http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=14||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=122||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=83||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=18||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=19||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=118||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=152||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=20||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=21||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=22||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=87||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=23||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=24||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=25||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=26||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=27||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=28||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=29||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=30||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=31||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=32||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=33||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=34||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=78||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=79||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=84||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=117||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=86||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=120||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=137||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=138||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=35||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=36||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=37||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=38||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=115||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=40||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=133||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=141||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=43||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=147||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=74||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=103||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=114||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=151||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=153||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=156||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=157||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=44||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=45||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=46||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=48||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=49||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=47||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=88||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=106||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=111||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=121||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=123||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=50||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=51||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=52||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=54||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=55||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=57||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=75||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=59||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=60||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=61||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=131||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=132||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=67||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=112||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=130||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=127||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=128||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=129||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=139||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=140||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=69||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=107||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=71||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=80||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=72||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=93||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=94||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=95||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=96||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=97||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=98||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=99||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=100||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=101||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=102||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=116||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=119||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=142||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=143||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=144||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=145||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=146||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=148||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=125||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=126||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=134||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=136||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=150||http://mms.163.com/new_web/cm_lv2_pic.jsp?type=1&catID=154||http://mms.163.com/
new_web/cm_lv2_pic.jsp?type=1&catID=155"

picAllNameArr = split(picAllName,"||")
picAllUrlArr = split(picAllUrl,"||")

ShowLog("爬行开始!")
Dim Url

for i = 0 to ubound(picAllNameArr)
showLog("开始抓取栏目: " & picAllNameArr(i))
'write_file "test.txt","AAA" & chr(9) & picAllUrlArr(i) & chr(9) & picAllNameArr(i) & chr(10)
getPageCount picAllUrlArr(i),picAllNameArr(i)
showLog("累了,休息2秒钟")
wait 2000
next

ShowLog("开始下载!")
savePath = "E:\切图\163_pic" '保存路径<<<<<<<<<<<<<<<<<<<<<<<<<<<
down_head = "http://mmsimg.163.com/new_web/loaditem.jsp/type=0/path=" '彩图<<<<<<<<<<<<<<<<<<<<<<<<<<<
'down_head = "http://mmsimg.163.com/new_web/loaditem.jsp/type=1/path=" '动画<<<<<<<<<<<<<<<<<<<<<<<<<<<
imageSize = "240x320||176x220||176x180||144x176||132x160||128x160||128x146||128x128||128x96||120x160||120x144||120x128||120x101||96x113||80x80"
imageSiezArr = split(imageSize ,"||")

'建立数据库连接
Set conn = CreateObject("ADODB.Connection")
DSNtemp = "DRIVER={SQL Server};SERVER=127.0.0.1;UID=sa;PWD=cnnc;DATABASE=WebSpider"
conn.open DSNtemp
sql = "select * from pic where fromSite='网易' and localPath is null order by id"
set rs = CreateObject("Adodb.recordset")
rs.open sql,conn,1,3
id = 1
do while not rs.eof
url = rs("url")
if left(url,1) = "/" then url = right(url,len(url)-1)
urlArr = split(url,"/")
urlPathNum = ubound(urlArr) - 1 '有几级目录
localPath = ""

'第一种文件名命名方法,适用于一套图片放一个目录
for i = 0 to urlPathNum
localPath = localPath & "\" & urlArr(i)
next
fileName = urlArr(urlPathNum + 1) '文件名
'filePath = savePath & localPath '新路径
'fileExcArr = split(urlArr(urlPathNum + 1),".") 'fileExcArr(ubound(fileExcArr))=扩展名

'第二种文件名命名方法,适用于多套图片放同一目录,如a_01 a_02 b_01 b_02
'for i = 0 to urlPathNum - 1
' localPath = localPath & "\" & urlArr(i)
'next
'fileExcArr = split(urlArr(urlPathNum + 1),".")
'fileName = urlArr(urlPathNum) & "." & fileExcArr(1) '新文件名
'filePath = savePath & localPath '新路径

'msgbox("Path: " & filePath & chr(13) & "Name: " & fileName & "")
'msgbox("url: " & down_head & url_old & chr(13) & "local: " & filePath & "\" & fileName & "")

down = False
downSizeStatus = ""

for s = 0 to Ubound(imageSiezArr)
downUrl = down_head & "/" & replace(url,"128x128",imageSiezArr(s))
fileStream = GetBody(downUrl)

if len(fileStream) > 0 then
fileNameTemp = split(fileName,".")
fileName = imageSiezArr(s) & "." & fileNameTemp(ubound(fileNameTemp))
if not down then
localSavePath = savePath & "\" & imageSiezArr(s) & localPath
CreateDIR localSavePath
down = SaveToFile(fileStream , localSavePath & "\" & fileName) '返回True则下载成功
imageMaxSize = imageSiezArr(s)
end if
downSizeStatus = downSizeStatus & "1,"
else
downSizeStatus = downSizeStatus & "0,"
end if
next

'ShowLog(replace(localPath,"\","/"))
'ShowLog(fileName)
'ShowLog(imageWidth)
'ShowLog(imageHeight)
if down then
imageMaxSizeTemp = split(imageMaxSize , "x")
imageWidth = imageMaxSizeTemp (0)
imageHeight = imageMaxSizeTemp (1)

rs("localPath") = localPath
rs("localName") = fileName
rs("maxWidth") = imageWidth
rs("maxHeight") = imageHeight
rs("downSizeStatus") = left(downSizeStatus , len(downSizeStatus)-1)
rs("downtime") = now()
rs.update
ShowLog("" & rs(0) & "条记录: [" & rs("name") & "] 下载完成 , 最大尺寸是: " & imageWidth & "x" & imageHeight)
end if
rs.movenext
if id mod 10 = 0 then
ShowLog("累了,休息5秒钟")
wait 3000
end if
id = id + 1
loop
rs.close
set rs = Nothing
ShowLog("下载完成!")

End Sub

function getPageCount(Url,picType) '读取栏目页面数
html = getHTTPPage(url)
index = instr(html,"第<select name=""page"" onChange=""javascript:document.upNavForm.submit();""></select>页")
if index = 0 then '如果为空
regStr = "<option value=\""(\d+)\""(>| selected>)(\d+)<\/option>\n<\/select>页<\/td><\/tr><\/form>"

Set objRegExp = New Regexp '建立对象
objRegExp.IgnoreCase = True '大小写忽略
objRegExp.Global = True '全局为真
objRegExp.Pattern = regStr '匹配字段
set mm = objRegExp.Execute(html) '执行查找,Html为输入参数

For Each Match in mm '进入循环
pageArr = split(CheckExp(regStr, Match.Value,"$1||$3"),"||")
if isArray(pageArr) and isNumeric(pageArr(0)) and pageArr(0) = pageArr(1) then exit for
next
set objRegExp = Nothing

if isArray(pageArr) and isNumeric(pageArr(0)) and pageArr(0) = pageArr(1) then
'msgbox("类别: " & picType & Chr(13) & "地址: " & Url & Chr(13) & "总共有: "& pageArr(0) & "")
msg = picType & " 共有" & pageArr(0) & ""
getPicUrl url,pageArr(0),picType
else
msg = picType & Chr(9) & Url & Chr(9) & "读取失败了" & chr(10)
end if
else
msg = picType & Chr(9) & Url & Chr(9) & "该类别没图片" & chr(10)
end if
showLog(msg)
end function

function getPicUrl(url,page,picType) '抓取各分页图片信息
for i = 1 to page
'http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=193
'http://mms.163.com/new_web/cm_lv2_pic.jsp?type=0&catID=193&ord=dDate&page=2
if i > 1 then
urlTemp = url & "&ord=dDate&page=" & i
else
urlTemp = url
end if
Html = getHTTPPage(urlTemp)

'<SCRIPT>showPic('44747','0','/ldw/0_050519115459_539/128x128.jpg','1','编号:44747\n名字: 猴\n人气:139');</SCRIPT>
regStr = "<SCRIPT>showPic\('\d+\','\d\','(.+)\','\d\','编号:\d+\\n名字: (.+)\\n人气:(\d+)\'\);<\/SCRIPT>"

Set objRegExp = New Regexp '建立对象
objRegExp.IgnoreCase = True '大小写忽略
objRegExp.Global = True '全局为真
objRegExp.Pattern = regStr '匹配字段
set mm = objRegExp.Execute(Html) '执行查找,Html为输入参数

For Each Match in mm '进入循环
picInfo = CheckExp(regStr, Match.Value,"$1||$2||$3||" & picType) '地址||名称||人气||类别
'write_file "网易MMS图片.txt",picInfo & chr(9) & urlTemp & chr(10)
showLog(" " & picInfo) ' & chr(9) & urlTemp & chr(10)
saveToDate picInfo
next
set mm = Nothing
Set objRegExp = Nothing
next
end function

function saveToDate(str) '保存到数据库
arr = split(str,"||")
if ubound(arr)>0 then
picUrl = trim(arr(0)) 'trim(replace(arr(0),"128x128","240x320"))
picName = trim(arr(1))
picDown = trim(arr(2))
picType = trim(arr(3))
end if

Set
conn = CreateObject("ADODB.Connection")
DSNtemp="DRIVER={SQL Server};SERVER=127.0.0.1;UID=sa;PWD=cnnc;DATABASE=WebSpider"
conn.open DSNtemp

pic_Type = 1 '彩图 = 1 ,动画 = 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
sql = "insert into pic (name,url,type,click,picType,fromSite) values('"&picName&"','"&picUrl&"','"&picType&"','"&picdown&"'," & pic_Type & ",'网易')"
conn.execute(sql)

end function

function getHTTPPage(url) '返回值getHTTPPage是目标网页的html代码
dim Http
set Http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage = BytesToBstr(Http.responseBody,"GB2312") '转换原来默认的UTF-8编码转换成GB2312编码,否则直接用XMLHTTP组件调用有中文字符的网页得到的将是乱码
set http=nothing
if err.number<>0 then err.Clear
end function

Function BytesToBstr(body,CodeType) '转换乱玛
dim objstream
set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = CodeType
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function

Function CheckExp(patrn,str,tagstr) '匹配参数,文本,替换字符串
Dim regEx,Matches

Set regEx=New RegExp '建立一个新对像
regEx.Pattern=patrn '设置模板
regEx.IgnoreCase=true '搜索是否区分大小写的 true表是不区分 flase表示区分
regEx.Global=True '搜索是否应用于整个字符串

Matches=regEx.replace(str,tagstr) '匹配并替代字符串

CheckExp=Matches '返回函数结果
end function

Function write_file(filename,Str) '向文件中写文字
Const ForReading = 1, ForWriting = 2 ,ForAppending = 8
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(filename, ForAppending , true)
f.write Str
f.close
Set fso = nothing
End Function

function CreateDIR(byval LocalPath) '建立目录
on error resume next
LocalPath = replace(LocalPath,"\","/")
set FileObject = createobject("Scripting.FileSystemObject")
patharr = split(LocalPath,"/")
path_level = ubound(patharr)
for i = 0 to path_level
if i=0 then
pathtmp=patharr(0) & "/"
else
pathtmp = pathtmp & patharr(i) & "/"
cpath = left(pathtmp,len(pathtmp)-1)
if not FileObject.FolderExists(cpath) then
FileObject.CreateFolder(cpath)
end if
end if
next
set FileObject = nothing
if err.number<>0 then
CreateDIR = false
err.Clear
else
CreateDIR = true
end if
end function

Function GetBody(url)
'远程获取内容
'url地址可以是一个htm,也可以是gif或mid等其他媒体.或rar或zip文件.
'当媒体文件被下载,并没有过期之前,iis会返回一个403错误,提示媒体并没有过去.
'如果要强制重新下载,必须将ie的cooker清空.下载的历史脱机文件清空.
Dim Retrieval
Dim ret(2)
'建立XMLHTTP对象
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
'ret(0) = .ResponseBody
GetBody = .ResponseBody
'MsgBox Left(getbody,4)
'MsgBox .getAllResponseHeaders()
'MsgBox .getResponseHeader("Content-Type") '当前下载对象的type
ret(1)= .getResponseHeader("Content-Type")
'MsgBox .getResponseHeader("Content-Length") '当前下载对象的长度,即图片或铃声文件的长度
ret(2) =.getResponseHeader("Content-Length")
End With
'getbody=ret
Set Retrieval = Nothing
End Function

Function SaveToFile(Stream, FilePath) '将流内容保存为文件
Dim objStream

On Error Resume Next

'建立ADODB.Stream对象,必须要ADO 2.5以上版本
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 1 '以二进制模式打开
objStream.Open
objstream.write Stream

objstream.SaveToFile FilePath, 2 '2=覆盖已经存在的文件,1=不覆盖
'adSaveCreateNotExist =1
'adSaveCreateOverWrite =2
objstream.Close()
'关闭对象,释放资源
Set objstream = Nothing

if err.Number <> 0 then
SaveToFile = false
else
SaveToFile = true
end if
End Function

相关文章推荐

如果觉得我的文章对您有用,可否请我喝杯速溶咖啡