-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml_test.py
249 lines (242 loc) · 11.6 KB
/
html_test.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
POINT = '''
<div class="section-contents"><img src="https://flush-image-prod.s3.ap-northeast-2.amazonaws.com/01GAJ695CS0E2Q5HVVVNDAD5FG/P026110.webp" alt=""><span class="btn-detection" data-color="blue" data-active="true" style="top: 65%; left: 51%;"><span class="btn-detection-inner"></span></span></div>
'''
PRODUCT_INFO = '''
<section class="info-section section-product-info">
<header>
<h3 class="title">Product Information</h3>
</header>
<div class="section-contents">
<div class="info-grouped">
<div class="grouped-header">
<h3 class="title">Basic Information</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Product ID</dt>
<dd>SB99724</dd>
</div>
<div class="info-item">
<dt>Product Name</dt>
<dd style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><span
class="empty">-</span></dd>
</div>
<div class="info-item">
<dt>Product No.</dt>
<dd style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><span
class="empty">-</span></dd>
</div>
</dl>
<div class="grouped-header">
<h3 class="title">Key Attribute Tags</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Category > Item</dt>
<dd>
<div class="select-category-item">Knitwear > Turtleneck</div>
</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Length</dt>
<dd>Normal</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Sleeve Length</dt>
<dd>Long Sleeves</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Neckline</dt>
<dd>Turtle Neck</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Fit</dt>
<dd>Normal</dd>
</div>
<div class="info-item"></div>
</dl>
</div>
<div class="section-footer">
<form>
<button class="product-link" formaction="https://www.wconcept.co.kr/Product/301034416" formtarget="_blank">
<i class="icon left"><svg class="ui-control ui-icon" viewBox="0 0 24 24" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#f8f9fa" d="M18.9 15c-1.428 0-2.664 0.78-3.336 1.92l-6.816-3.576c0.156-0.42 0.252-0.876 0.252-1.344s-0.096-0.924-0.252-1.344l6.816-3.576c0.684 1.14 1.92 1.92 3.336 1.92 2.148 0 3.9-1.752 3.9-3.9s-1.752-3.9-3.9-3.9c-2.148 0-3.9 1.752-3.9 3.9 0 0.084 0.024 0.156 0.024 0.228l-7.284 3.816c-0.696-0.648-1.62-1.044-2.64-1.044-2.148 0-3.9 1.752-3.9 3.9s1.752 3.9 3.9 3.9c1.020 0 1.944-0.408 2.64-1.044l7.284 3.816c0 0.084-0.024 0.156-0.024 0.228 0 2.148 1.752 3.9 3.9 3.9s3.9-1.752 3.9-3.9c0-2.148-1.752-3.9-3.9-3.9zM18.9 3c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1zM5.1 14.1c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1zM18.9 21c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1z">
</path>
</svg></i>
<span class="txt">Produck Link</span></button>
</form>
</div>
</div>
</section>
'''
TABLE = '''<section class="info-section" style="margin-top: 0px; padding-top: 40px;">
<header>
<h3 class="title">Product Tags<span class="bar"></span>
<div class="ui-control ui-select-control undefined type-attribute outline outline-0">
<div class="select-control-container css-b62m3t-container"><span
id="react-select-ai-attribute-live-region" class="css-7pg0cj-a11yText"></span><span
aria-live="polite" aria-atomic="false" aria-relevant="additions text"
class="css-7pg0cj-a11yText"></span>
</div>
</div>
</h3>
</header><input type="hidden" name="categoryGroup" value="CLOTHING">
<div class="section-contents">
<div class="info-grouped">
<div class="grouped-header">
<h3 class="title">Key Attribute Tags</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Category > Item</dt>
<dd>
<div class="select-category-item">Knitwear > Turtleneck</div>
</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Length</dt>
<dd>Normal</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Sleeve Length</dt>
<dd>Long Sleeves</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Neckline</dt>
<dd>Turtle Neck</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Fit</dt>
<dd>Normal</dd>
</div>
<div class="info-item"></div>
</dl>
<div class="grouped-header">
<h3 class="title">Detailed Attribute Tags (Select up to 5 tags)</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Color</dt>
<dd>White</dd>
</div>
<div class="info-item">
<dt>Print</dt>
<dd>Solid</dd>
</div>
<div class="info-item">
<dt>Texture</dt>
<dd>Knit</dd>
</div>
<div class="info-item">
<dt>Detail</dt>
<dd>Drop Shoulder</dd>
</div>
<div class="info-item">
<dt>Style</dt>
<dd>Casual</dd>
</div>
<div class="info-item"></div>
</dl>
</div>
</div>
</section>'''
def product_info(data):
product = f'''
<section class="info-section section-product-info">
<div class="section-contents">
<div class="info-grouped">
<div class="grouped-header">
<h3 class="title">Basic Information</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Product ID</dt>
<dd>{data['item_id']}</dd>
</div>
<div class="info-item">
<dt>Product Name</dt>
<dd style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{data['name']}</dd>
</div>
<div class="info-item">
<dt>Product No.</dt>
<dd style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"><span
class="empty">-</span></dd>
</div>
</dl>
</div>
<div class="section-footer">
<form>
<button class="product-link" formaction={data['url']} formtarget="_blank">
<i class="icon left"><svg class="ui-control ui-icon" viewBox="0 0 24 24" width="20px" height="20px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path fill="#f8f9fa" d="M18.9 15c-1.428 0-2.664 0.78-3.336 1.92l-6.816-3.576c0.156-0.42 0.252-0.876 0.252-1.344s-0.096-0.924-0.252-1.344l6.816-3.576c0.684 1.14 1.92 1.92 3.336 1.92 2.148 0 3.9-1.752 3.9-3.9s-1.752-3.9-3.9-3.9c-2.148 0-3.9 1.752-3.9 3.9 0 0.084 0.024 0.156 0.024 0.228l-7.284 3.816c-0.696-0.648-1.62-1.044-2.64-1.044-2.148 0-3.9 1.752-3.9 3.9s1.752 3.9 3.9 3.9c1.020 0 1.944-0.408 2.64-1.044l7.284 3.816c0 0.084-0.024 0.156-0.024 0.228 0 2.148 1.752 3.9 3.9 3.9s3.9-1.752 3.9-3.9c0-2.148-1.752-3.9-3.9-3.9zM18.9 3c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1zM5.1 14.1c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1zM18.9 21c-1.152 0-2.1-0.948-2.1-2.1s0.948-2.1 2.1-2.1c1.152 0 2.1 0.948 2.1 2.1s-0.948 2.1-2.1 2.1z">
</path>
</svg></i>
<span class="txt">Produck Link</span></button>
</form>
</div>
</div>
</section>
'''
return product
def product_tag(data):
product = f'''<section class="info-section">
<div class="section-contents">
<div class="info-grouped">
<div class="grouped-header">
<h3 class="title">Key Attribute Tags</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Category > Item</dt>
<dd>
<div class="select-category-item">{data['category']} > {data['sub_category']}</div>
</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Length</dt>
<dd>{data['length']}</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Sleeve Length</dt>
<dd>{data['sleeve_length']}</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Neckline</dt>
<dd>{data['neck_line']}</dd>
</div>
<div class="info-item">
<dt data-dirty="false">Fit</dt>
<dd>{data['fit']}</dd>
</div>
<div class="info-item"></div>
</dl>
<div class="grouped-header">
<h3 class="title">Detailed Attribute Tags (Select up to 5 tags)</h3>
</div>
<dl class="list-info">
<div class="info-item">
<dt>Color</dt>
<dd>{data['tag_color']}</dd>
</div>
<div class="info-item">
<dt>Print</dt>
<dd>{data['print']}</dd>
</div>
<div class="info-item">
<dt>Texture</dt>
<dd>{data['texture']}</dd>
</div>
<div class="info-item">
<dt>Detail</dt>
<dd>{data['detail']}</dd>
</div>
<div class="info-item">
<dt>Style</dt>
<dd>{data['look']}</dd>
</div>
<div class="info-item"></div>
</dl>
</div>
</div>
</section>'''
return product