-
Notifications
You must be signed in to change notification settings - Fork 0
/
index03.js
329 lines (302 loc) · 12.9 KB
/
index03.js
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
import cheerio from 'cheerio';
import request from 'superagent';
import fs from 'fs';
import models from './models/index';
const getData = async (str) =>{
let result = await request.get(str);
console.log(result.text);
return result.text;
}
//getData();
const handerData = async (value) =>{
//console.log(data);
try {
// 读取网页 保存到txt
const html = await getData(value);
// await fs.writeFile(`./data/${value}.txt`,html);
//const html = await fs.readFileSync('./data/03.txt','utf-8');
//console.log("html",html);
let $ =cheerio.load(html);
//console.log("test");
//console.log($(".panel-body").html());
//let items = [];
// $ = $('script').remove();
// console.log("script",$.html());
// console.log($('.main .tryitbtn').attr('href'));
//console.log("a",a);
let content = $(".panel-body").html();
//console.log(tryArr);
let pathArray = value.split("?");
let path = pathArray[pathArray.length - 1];
// //console.log(path[path.length - 1]);
await models.Article.create({content:content,path:path});
//fs.appendFileSync('./data/04.txt',a);
//console.log("a",a);
} catch (e) {
console.log("e",e);
} finally {
}
}
const tryarray = [
'/try/try.php?filename=tryhtml_intro',
'/try/try.php?filename=tryhtml_intro_utf8',
'/try/try.php?filename=tryhtml_intro',
'/try/try.php?filename=tryhtml_basic_link',
'/try/try.php?filename=tryhtml_headers',
'/try/try.php?filename=tryhtml_paragraphs1',
'/try/try.php?filename=tryhtml_basic_link',
'/try/try.php?filename=tryhtml_basic_img',
'/try/try.php?filename=tryhtml_headers',
'/try/try.php?filename=tryhtml_hr',
'/try/try.php?filename=tryhtml_comment',
'/try/try.php?filename=tryhtml_headers',
'/try/try.php?filename=tryhtml_comment',
'/try/try.php?filename=tryhtml_hr',
'/try/try.php?filename=tryhtml_paragraphs1',
'/try/try.php?filename=tryhtml_paragraphs0',
'/try/try.php?filename=tryhtml_paragraphs',
'/try/try.php?filename=tryhtml_poem',
'/try/try.php?filename=tryhtml_paragraphs1',
'/try/try.php?filename=tryhtml_paragraphs',
'/try/try.php?filename=tryhtml_poem',
'/try/try.php?filename=tryhtml_paragraphs2',
'/try/try.php?filename=tryhtml_styles',
'/try/try.php?filename=tryhtml_style',
'/try/try.php?filename=tryhtml_linknoline',
'/try/try.php?filename=tryhtml_link',
'/try/try.php?filename=tryhtml_bodybgstyle',
'/try/try.php?filename=tryhtml_bodybgcol',
'/try/try.php?filename=tryhtml_newfont',
'/try/try.php?filename=tryhtml_headeralign',
'/try/try.php?filename=tryhtml_header',
'/try/try.php?filename=tryhtml_title',
'/try/try.php?filename=tryhtml_base',
'/try/try.php?filename=tryhtml_meta',
'/try/try.php?filename=tryhtml_script',
'/try/try.php?filename=tryhtml_noscript',
'/try/try.php?filename=tryhtml_script',
'/try/try.php?filename=tryhtml_noscript',
'/try/try.php?filename=tryjs_intro_document_write',
'/try/try.php?filename=tryjs_intro_event',
'/try/try.php?filename=tryjs_intro_style',
'/try/try.php?filename=tryhtml5_audio_all',
'/try/try.php?filename=tryhtml5_datalist',
'/try/try.php?filename=tryhtml5_keygen',
'/try/try.php?filename=tryhtml5_output',
'/try/try.php?filename=tryhtml5_input_autocomplete',
'/try/try.php?filename=tryhtml5_form_novalidate',
'/try/try.php?filename=tryhtml5_input_autofocus',
'/try/try.php?filename=tryhtml5_input_form',
'/try/try.php?filename=tryhtml5_input_formaction',
'/try/try.php?filename=tryhtml5_input_formenctype',
'/try/try.php?filename=tryhtml5_input_formmethod',
'/try/try.php?filename=tryhtml5_input_formnovalidate',
'/try/try.php?filename=tryhtml5_input_formtarget',
'/try/try.php?filename=tryhtml5_input_height_width',
'/try/try.php?filename=tryhtml5_datalist',
'/try/try.php?filename=tryhtml5_input_max_min',
'/try/try.php?filename=tryhtml5_input_multiple',
'/try/try.php?filename=tryhtml5_input_pattern',
'/try/try.php?filename=tryhtml5_input_placeholder',
'/try/try.php?filename=tryhtml5_input_required',
'/try/try.php?filename=tryhtml5_input_step',
'/try/try.php?filename=tryhtml5_html_manifest',
'/try/try.php?filename=tryhtml_intro',
'/try/try.php?filename=tryhtml_headers',
'/try/try.php?filename=tryhtml_paragraphs1',
'/try/try.php?filename=tryhtml_basic_link',
'/try/try.php?filename=tryhtml_basic_img',
'/try/try.php?filename=tryhtml_headers',
'/try/try.php?filename=tryhtml_comment',
'/try/try.php?filename=tryhtml_hr',
'/try/try.php?filename=tryhtml_paragraphs1',
'/try/try.php?filename=tryhtml_paragraphs2',
'/try/try.php?filename=tryhtml_paragraphs',
'/try/try.php?filename=tryhtml_poem',
'/try/try.php?filename=tryhtml_formattingch',
'/try/try.php?filename=tryhtml_pre',
'/try/try.php?filename=tryhtml_computeroutput',
'/try/try.php?filename=tryhtml_address',
'/try/try.php?filename=tryhtml_abbr',
'/try/try.php?filename=tryhtml_bdo',
'/try/try.php?filename=tryhtml_q',
'/try/try.php?filename=tryhtml_del',
'/try/try.php?filename=tryhtml_styles',
'/try/try.php?filename=tryhtml_bodybgstyle',
'/try/try.php?filename=tryhtml_newfont',
'/try/try.php?filename=tryhtml_headeralign',
'/try/try.php?filename=tryhtml_font-family',
'/try/try.php?filename=tryhtml_font-size',
'/try/try.php?filename=tryhtml_color',
'/try/try.php?filename=tryhtml_fontall',
'/try/try.php?filename=tryhtml_style',
'/try/try.php?filename=tryhtml_linknoline',
'/try/try.php?filename=tryhtml_link',
'/try/try.php?filename=tryhtml_links',
'/try/try.php?filename=tryhtml_imglink',
'/try/try.php?filename=tryhtml_link_target',
'/try/try.php?filename=tryhtml_link_locations',
'/try/try.php?filename=tryhtml_frame_getfree',
'/try/try.php?filename=tryhtml_mailto',
'/try/try.php?filename=tryhtml_mailto2',
'/try/try.php?filename=tryhtml_images',
'/try/try.php?filename=tryhtml_images2',
'/try/try.php?filename=tryhtml_image_align',
'/try/try.php?filename=tryhtml_image_float',
'/try/try.php?filename=tryhtml_imglink',
'/try/try.php?filename=tryhtml_areamap',
'/try/try.php?filename=tryhtml_tables',
'/try/try.php?filename=tryhtml_tables3',
'/try/try.php?filename=tryhtml_table_headers',
'/try/try.php?filename=tryhtml_tables2',
'/try/try.php?filename=tryhtml_table_span',
'/try/try.php?filename=tryhtml_table_elements',
'/try/try.php?filename=tryhtml_table_cellpadding',
'/try/try.php?filename=tryhtml_table_cellspacing',
'/try/try.php?filename=tryhtml_lists4',
'/try/try.php?filename=tryhtml_lists',
'/try/try.php?filename=tryhtml_lists_ordered',
'/try/try.php?filename=tryhtml_lists_unordered',
'/try/try.php?filename=tryhtml_lists2',
'/try/try.php?filename=tryhtml_nestedlists2',
'/try/try.php?filename=tryhtml_lists3',
'/try/try.php?filename=tryhtml_input',
'/try/try.php?filename=tryhtml_inputpassword',
'/try/try.php?filename=tryhtml_checkbox',
'/try/try.php?filename=tryhtml_radio',
'/try/try.php?filename=tryhtml_select2',
'/try/try.php?filename=tryhtml_select3',
'/try/try.php?filename=tryhtml_textarea',
'/try/try.php?filename=tryhtml_button',
'/try/try.php?filename=tryhtml_legend',
'/try/try.php?filename=tryhtml_form_submit',
'/try/try.php?filename=tryhtml_form_checkbox',
'/try/try.php?filename=tryhtml_form_radio',
'/try/try.php?filename=tryhtml_form_mail',
'/try/try.php?filename=tryhtml_iframe',
'/try/try.php?filename=tryhtml_title',
'/try/try.php?filename=tryhtml_base',
'/try/try.php?filename=tryhtml_meta',
'/try/try.php?filename=tryhtml_script',
'/try/try.php?filename=tryhtml_noscript',
'/try/try.php?filename=tryhtml_video_html5_4',
'/try/try.php?filename=tryhtml_videoembed',
'/try/try.php?filename=tryhtml_videoobject',
'/try/try.php?filename=tryhtml_video_html5',
'/try/try.php?filename=tryhtml_video_html5_4',
'/try/try.php?filename=tryhtml_videolink',
'/try/try.php?filename=tryhtml_iframe_height_width',
'/try/try.php?filename=tryhtml_iframe_frameborder',
'/try/try.php?filename=tryhtml_iframe_target',
'/try/try.php?filename=tryhtml_links',
'/try/try.php?filename=tryhtml_link_target',
'/try/try.php?filename=tryhtml_imglink',
'/try/try.php?filename=tryhtml_frame_getfree',
'/try/try.php?filename=tryhtml_mailto',
'/try/try.php?filename=tryhtml_mailto2',
'/try/try.php?filename=tryhtml_formatting',
'/try/try.php?filename=tryhtml_formattingch',
'/try/try.php?filename=tryhtml_pre',
'/try/try.php?filename=tryhtml_computeroutput',
'/try/try.php?filename=tryhtml_address',
'/try/try.php?filename=tryhtml_abbr',
'/try/try.php?filename=tryhtml_bdo',
'/try/try.php?filename=tryhtml_q',
'/try/try.php?filename=tryhtml_del',
'/try/try.php?filename=tryhtml5_video_bear',
'/try/try.php?filename=tryhtml5_svg_ex',
'/try/try.php?filename=tryhtml5_canvas_empty',
'/try/try.php?filename=tryhtml5_canvas_first',
'/try/try.php?filename=tryhtml5_canvas_tut_path',
'/try/try.php?filename=tryhtml5_canvas_tut_path2',
'/try/try.php?filename=tryhtml5_canvas_tut_text',
'/try/try.php?filename=tryhtml5_canvas_tut_text2',
'/try/try.php?filename=tryhtml5_canvas_tut_grad',
'/try/try.php?filename=tryhtml5_canvas_tut_grad2',
'/try/try.php?filename=tryhtml5_canvas_tut_img',
'/try/try.php?filename=tryhtml5_sse',
'/try/try.php?filename=tryhtml5_input_type_color',
'/try/try.php?filename=tryhtml5_input_type_date',
'/try/try.php?filename=tryhtml5_input_type_datetime',
'/try/try.php?filename=tryhtml5_input_type_datetime-local',
'/try/try.php?filename=tryhtml5_input_type_email',
'/try/try.php?filename=tryhtml5_input_type_month',
'/try/try.php?filename=tryhtml5_input_type_number',
'/try/try.php?filename=tryhtml5_form_number_adv',
'/try/try.php?filename=tryhtml5_input_type_range',
'/try/try.php?filename=tryhtml5_input_type_search',
'/try/try.php?filename=tryhtml5_input_type_tel',
'/try/try.php?filename=tryhtml5_input_type_time',
'/try/try.php?filename=tryhtml5_input_type_url',
'/try/try.php?filename=tryhtml5_input_type_week',
'/try/try.php?filename=tryhtml5_video_all',
'/try/try.php?filename=tryhtml5_video_js_prop',
'/try/try.php?filename=tryhtml_pulpitimage',
'/try/try.php?filename=tryhtml_images',
'/try/try.php?filename=tryhtml_images2',
'/try/try.php?filename=tryhtml_image_align',
'/try/try.php?filename=tryhtml_image_float',
'/try/try.php?filename=tryhtml_imglink',
'/try/try.php?filename=tryhtml_areamap',
'/try/try.php?filename=tryhtml_lists4',
'/try/try.php?filename=tryhtml_lists',
'/try/try.php?filename=tryhtml_lists_ordered',
'/try/try.php?filename=tryhtml_lists_unordered',
'/try/try.php?filename=tryhtml_lists2',
'/try/try.php?filename=tryhtml_nestedlists2',
'/try/try.php?filename=tryhtml_lists3',
'/try/try.php?filename=tryhtml_layout_divs',
'/try/try.php?filename=tryhtml_layout_tables',
'/try/try.php?filename=tryhtml_layout_divs',
'/try/try.php?filename=tryhtml_layout_tables',
'/try/try.php?filename=tryhtml_tables',
'/try/try.php?filename=tryhtml_tables3',
'/try/try.php?filename=tryhtml_table_headers',
'/try/try.php?filename=tryhtml_tables2',
'/try/try.php?filename=tryhtml_table_span',
'/try/try.php?filename=tryhtml_table_elements',
'/try/try.php?filename=tryhtml_table_cellpadding',
'/try/try.php?filename=tryhtml_table_cellspacing',
'/try/try.php?filename=tryhtml_input',
'/try/try.php?filename=tryhtml_inputpassword',
'/try/try.php?filename=tryhtml_radio',
'/try/try.php?filename=tryhtml_checkbox',
'/try/try.php?filename=tryhtml_select2',
'/try/try.php?filename=tryhtml_select3',
'/try/try.php?filename=tryhtml_textarea',
'/try/try.php?filename=tryhtml_button',
'/try/try.php?filename=tryhtml_legend',
'/try/try.php?filename=tryhtml_form_submit',
'/try/try.php?filename=tryhtml_form_checkbox',
'/try/try.php?filename=tryhtml_form_radio',
'/try/try.php?filename=tryhtml_form_mail',
'/try/try.php?filename=tryhtml_syntax_nobody',
'/try/try.php?filename=tryhtml_syntax_nohead',
'/try/try.php?filename=tryhtml_syntax_javascript',
'/try/try.php?filename=tryhtml_colorhex',
'/try/try.php?filename=tryhtml5_webworker',
'/try/try.php?filename=tryhtml5_webworker',
'/try/try.php?filename=tryhtml5_section',
'/try/try.php?filename=tryhtml5_article',
'/try/try.php?filename=tryhtml5_nav',
'/try/try.php?filename=tryhtml5_aside',
'/try/try.php?filename=tryhtml5_header',
'/try/try.php?filename=tryhtml5_footer',
'/try/try.php?filename=tryhtml5_figcaption',
'/try/try.php?filename=tryhtml5_geolocation',
'/try/try.php?filename=tryhtml5_geolocation_error',
'/try/try.php?filename=tryhtml5_geolocation_map',
'/try/try.php?filename=tryhtml5_geolocation_map_script',
'/try/try.php?filename=tryhtml5_geolocation_watchposition',
'/try/try.php?filename=tryhtml5_webstorage_local',
'/try/try.php?filename=tryhtml5_webstorage_local_clickcount',
'/try/try.php?filename=tryhtml5_webstorage_session'
];
// const tryarray = [
// 'http://www.runoob.com/try/try.php?filename=tryhtml_intro'
// ]
tryarray.map((value) => {
handerData("http://www.runoob.com"+value);
console.log("value","http://www.runoob.com"+value);
});
//handerData(getData());