-
Notifications
You must be signed in to change notification settings - Fork 0
/
down-code-fun.py
359 lines (351 loc) · 9.24 KB
/
down-code-fun.py
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
import os
#html是干什么的?
html="""
<template>
<div class="flex-col page">
<div class="flex-col justify-start header group">
<div class="flex-col justify-start items-center relative group_2">
<img
class="image"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=a2be8e1dba12f84c79ed1daa42f28442.png"
/>
<div class="flex-col section pos_2">
<img
class="shrink-0 self-start image_4 image_5"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=bd02647ffbf5771dcd56ec394fdda54e.png"
/>
<span class="self-center text">高频违规占耕</span>
<img
class="shrink-0 self-end image_4"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=b35c7ac57cc799d266328ad9d1c8f23d.png"
/>
</div>
<img
class="image_2 pos"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=f1388774fbaf23ee3c7a720c1d020d52.png"
/>
</div>
<img
class="image_3 pos_3"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=887e4196e3f8807a15471080c9e4ed88.png"
/>
</div>
<div class="flex-col flex-1 group_5">
<div class="flex-row items-center relative group_3">
<div class="flex-col justify-start items-center shrink-0 relative group_4">
<img
class="image_9"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=14b5388917b714ee4bd2a4b33e4e846b.png"
/>
<div class="flex-col section_2 pos_4">
<img
class="self-start image_6 image_7"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=ced12c7ac8d0be8907864c039f6ff92d.png"
/>
<div class="flex-col self-stretch group_6">
<div class="flex-row group_7">
<div class="flex-row justify-start"><span class="text_2 text_3">马家圩1-4号</span></div>
<div class="flex-row justify-start items-center text-wrapper view_3">
<span class="font text_2 text_4">23</span>
</div>
<div class="flex-row justify-start items-center text-wrapper view">
<span class="font text_2">北庄村</span>
</div>
<div class="flex-row justify-start items-center text-wrapper view_2">
<span class="font text_2">崇贤街道</span>
</div>
</div>
<div class="section_3"></div>
</div>
<div class="self-stretch section_3 view_4"></div>
<div class="flex-col self-stretch group_8">
<img
class="self-start image_6"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=d4fca1537912c3b5257fe7e7e9e9fd49.png"
/>
<img
class="self-stretch image_9 image_10"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=0620806ba1f3bb417d82bb00aeef9f66.png"
/>
<div class="flex-col justify-start self-stretch relative group_9">
<div class="section_3 view_5"></div>
<img
class="image_11 pos_5"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=837559b3ad3fc9ce572e4f31d76d47d4.png"
/>
</div>
<div class="flex-col justify-start self-stretch relative group_10">
<div class="section_3 view_6"></div>
<img
class="image_11 pos_6"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=837559b3ad3fc9ce572e4f31d76d47d4.png"
/>
</div>
</div>
</div>
<img
class="image_12 pos_7"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=a7557728956a9ed27b5f60f96a2800ac.png"
/>
<img
class="image_12 pos_8"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=cbb59e216c3ee9df9cdbbeb433a787db.png"
/>
</div>
<img
class="flex-1 image_8 ml-123"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=cf8573c30f52cbac27c2de9a13aac509.png"
/>
</div>
<img
class="mt-40 shrink-0 image_13"
src="https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=dfb40add0b54be9a880194b8fbdc7e2a.png"
/>
</div>
</div>
</template>
<script>
export default {
components: {},
props: {},
data() {
return {};
},
methods: {},
};
</script>
<style scoped lang="css">
.ml-123 {
margin-left: 4.8047vw;
}
.page {
background-color: #070c20;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
height: 100%;
}
.header {
position: relative;
}
.group {
padding-bottom: 0.5078vw;
height: 5.5469vw;
}
.group_2 {
padding-bottom: 0.5078vw;
}
.image {
width: 99.7656vw;
height: 4.5313vw;
}
.section {
padding: 0.6641vw 21.9141vw 0.8984vw 22.0703vw;
background-image: url('https://ide.code.fun/api/image?token=659e37481bf67f00113eb5f2&name=05cc68e48270c02d7e69b79e57d3cba4.png');
background-size: 100% 100%;
background-repeat: no-repeat;
height: 4.2188vw;
}
.pos_2 {
position: absolute;
left: 0;
right: 0;
top: 0.8203vw;
}
.image_4 {
width: 10.8203vw;
height: 0.5859vw;
}
.image_5 {
margin-top: 2.0703vw;
}
.text {
margin-top: -2.6563vw;
color: #ffffff;
font-size: 2.5vw;
font-family: JZhongYi;
line-height: 2.3438vw;
letter-spacing: 0.25vw;
}
.image_2 {
width: 1.7969vw;
height: 1.7969vw;
}
.pos {
position: absolute;
left: 2.5vw;
top: 0.5469vw;
}
.image_3 {
width: 70.2344vw;
height: 2.3438vw;
}
.pos_3 {
position: absolute;
right: 12.5781vw;
bottom: 0;
}
.group_5 {
padding-left: 0.3125vw;
overflow-y: auto;
}
.group_3 {
margin-top: -0.3516vw;
padding: 0 0.8984vw;
}
.group_4 {
padding: 4.6484vw 0 41.4844vw;
width: 35.2734vw;
}
.image_9 {
width: 32.6172vw;
height: 2.4219vw;
}
.section_2 {
padding: 0vw 0 0vw;
border: solid 0vw #666692;
background-image: url('https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/6464806354fe000011626c75/16953483135654384355.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.pos_4 {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.image_6 {
width: 19.9219vw;
height: 3.9844vw;
}
.image_7 {
margin-left: -0.6641vw;
}
.group_6 {
margin-top: 3.6719vw;
padding: 0 1.25vw;
}
.group_7 {
padding: 0 1.4844vw 0.8203vw;
}
.text-wrapper {
width: 5.3516vw;
}
.view_3 {
margin-left: 2.6563vw;
}
.font {
font-size: 0.9375vw;
font-family: Adobe Heiti Std;
line-height: 0.8594vw;
color: #ff7840;
}
.text_2 {
text-transform: uppercase;
}
.text_3 {
color: #ff7840;
font-size: 0.9375vw;
font-family: FZLanTingHeiS-B-GB;
line-height: 0.8984vw;
}
.text_4 {
line-height: 0.7422vw;
}
.view {
margin-left: 3.125vw;
}
.view_2 {
margin-left: 2.5781vw;
}
.section_3 {
background-color: #20234866;
height: 2.4219vw;
}
.view_4 {
margin: 2.4609vw 1.25vw 0;
}
.group_8 {
margin-right: 1.0938vw;
margin-top: 3.125vw;
}
.image_10 {
margin-left: 1.4453vw;
}
.group_9 {
margin-top: 1.0938vw;
padding-top: 1.6016vw;
}
.view_5 {
margin-left: 1.2891vw;
margin-right: 0.1563vw;
}
.image_11 {
width: 27.3438vw;
height: 3.3203vw;
}
.pos_5 {
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
}
.group_10 {
margin-top: 1.0938vw;
padding-top: 1.5625vw;
}
.view_6 {
margin-left: 1.2891vw;
margin-right: 0.1563vw;
}
.pos_6 {
position: absolute;
left: 50%;
top: 0;
transform: translateX(-50%);
}
.image_12 {
width: 0.9766vw;
height: 0.9766vw;
}
.pos_7 {
position: absolute;
left: 0;
bottom: 0;
}
.pos_8 {
position: absolute;
right: 0;
bottom: 0;
}
.image_8 {
margin-right: 2.1094vw;
height: 42.5391vw;
}
.image_13 {
width: 99.6875vw;
height: 0.9375vw;
}
</style>
"""
import re,requests,os
pattern = r'https?://[^\s<>"]+\.png'
png_urls = re.findall(pattern, html)
# 循环遍历所有匹配到的URL
for img_url in png_urls:
# 从URL中提取图片名称
img_name = img_url.split('name=')[-1]
# 检查企业文件夹是否存在,不存在则创建
if not os.path.exists('./enterprise'):
os.makedirs('./enterprise')
# 完整的URL
full_url = img_url
# 下载图片
response = requests.get(full_url)
if response.status_code == 200:
# 构建保存路径
save_path = os.path.join('./enterprise', img_name)
# 保存图片到本地
with open(save_path, 'wb') as f:
f.write(response.content)