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
|
res = []
n=0
for i in fur['list']:
title = i['title']
summary = i['summary']
ext = json.loads(i['ext'])
try:
region = re.compile(r'\"区域\/\S+?\"').findall(ext['c_130']['filter']['text'])[0][4:-1]
except:
region = "Error"
print(n, title, summary, region, type, quality, blueprintAccess, furnitureAccess)
try:
type = re.compile(r'\"类型\/\S+?\"').findall(ext['c_130']['filter']['text'])[0][4:-1]
except:
type = "Error"
print(n, title, summary, region, type, quality, blueprintAccess, furnitureAccess)
try:
quality = re.compile(r'\"品质\/\S+?\"').findall(ext['c_130']['filter']['text'])[0][4:-1]
except:
quality = "Error"
print(n, title, summary, region, type, quality, blueprintAccess, furnitureAccess)
try:
blueprintAccess = re.compile(r'\"图纸获取方式\/\S+?\"').findall(ext['c_130']['filter']['text'])[0][8:-1]
except:
blueprintAccess = "Error"
print(n, title, summary, region, type, quality, blueprintAccess, furnitureAccess)
try:
furnitureAccess = re.compile(r'\"摆设获取方式\/\S+?\"').findall(ext['c_130']['filter']['text'])[0][8:-1]
except:
furnitureAccess = "Error"
print(n, title, summary, region, type, quality, blueprintAccess, furnitureAccess)
n=n+1
res.append([title, summary, region, type, quality, blueprintAccess, furnitureAccess])
|