File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,28 @@ for(const [i, r] of records.entries()) {
13
13
}
14
14
15
15
const crawler = async ( ) => {
16
- await Promise . all ( records . map ( async ( r ) => {
16
+ for ( const [ i , r ] of records . entries ( ) ) {
17
17
const response = await axios . get ( r . 링크 ) ;
18
18
if ( response . status === 200 ) {
19
19
const html = response . data ;
20
20
const $ = cheerio . load ( html ) ;
21
21
const text = $ ( '.score.score_left .star_score' ) . text ( ) ;
22
22
console . log ( r . 제목 , '평점' , text . trim ( ) ) ;
23
23
}
24
- } ) ) ;
24
+ }
25
25
} ;
26
+
27
+ // const crawler = async () => {
28
+ // await Promise.all(records.map( async (r) => {
29
+ // const response = await axios.get(r.링크);
30
+ // if (response.status === 200) {
31
+ // const html = response.data;
32
+ // const $ = cheerio.load(html);
33
+ // const text = $('.score.score_left .star_score').text();
34
+ // console.log(r.제목, '평점', text.trim());
35
+ // }
36
+ // }));
37
+ // };
38
+ // 순서 보장하지 않음
39
+
26
40
crawler ( ) ;
You can’t perform that action at this time.
0 commit comments