Showing
1 changed file
with
98 additions
and
2 deletions
... | @@ -320,9 +320,9 @@ function getAllToons3(){ | ... | @@ -320,9 +320,9 @@ function getAllToons3(){ |
320 | if (res.status === 200) { | 320 | if (res.status === 200) { |
321 | let naver2019 = []; | 321 | let naver2019 = []; |
322 | const $ = cheerio.load(res.data); | 322 | const $ = cheerio.load(res.data); |
323 | - const $movieList = $('#content > div.list_area.daily_img > ul > li'); | 323 | + const $toonList = $('#content > div.list_area.daily_img > ul > li'); |
324 | var tn = 2019; | 324 | var tn = 2019; |
325 | - $movieList.each(function (i) { | 325 | + $toonList.each(function (i) { |
326 | naver2019[i] = { | 326 | naver2019[i] = { |
327 | title: $(this).find('dl > dt > a').text(), | 327 | title: $(this).find('dl > dt > a').text(), |
328 | img: $(this).find('div > a > img').attr('src'), | 328 | img: $(this).find('div > a > img').attr('src'), |
... | @@ -337,6 +337,102 @@ function getAllToons3(){ | ... | @@ -337,6 +337,102 @@ function getAllToons3(){ |
337 | } | 337 | } |
338 | }, (error) => console.log(error)); | 338 | }, (error) => console.log(error)); |
339 | 339 | ||
340 | + //2018년 연재 네이버 웹툰 | ||
341 | + const naver2018 = 'https://comic.naver.com/webtoon/period.nhn?period=2018'; | ||
342 | + | ||
343 | + axios.get(naver2018).then(res => { | ||
344 | + if (res.status === 200) { | ||
345 | + let naver2018 = []; | ||
346 | + const $ = cheerio.load(res.data); | ||
347 | + const $toonList = $('#content > div.list_area.daily_img > ul > li'); | ||
348 | + var tn = 2018; | ||
349 | + $toonList.each(function (i) { | ||
350 | + naver2018[i] = { | ||
351 | + title: $(this).find('dl > dt > a').text(), | ||
352 | + img: $(this).find('div > a > img').attr('src'), | ||
353 | + index: $(this).find('li > div > a').attr('href'), | ||
354 | + year : tn | ||
355 | + }; | ||
356 | + }); | ||
357 | + | ||
358 | + const data = naver2018.filter(m => m.title); | ||
359 | + allWebtoonList3.push(data); | ||
360 | + //console.log(allWebtoonList3) | ||
361 | + } | ||
362 | + }, (error) => console.log(error)); | ||
363 | + | ||
364 | + //2017년 연재 네이버 웹툰 | ||
365 | + const naver2017 = 'https://comic.naver.com/webtoon/period.nhn?period=2017'; | ||
366 | + | ||
367 | + axios.get(naver2017).then(res => { | ||
368 | + if (res.status === 200) { | ||
369 | + let naver2017 = []; | ||
370 | + const $ = cheerio.load(res.data); | ||
371 | + const $toonList = $('#content > div.list_area.daily_img > ul > li'); | ||
372 | + var tn = 2017; | ||
373 | + $toonList.each(function (i) { | ||
374 | + naver2017[i] = { | ||
375 | + title: $(this).find('dl > dt > a').text(), | ||
376 | + img: $(this).find('div > a > img').attr('src'), | ||
377 | + index: $(this).find('li > div > a').attr('href'), | ||
378 | + year : tn | ||
379 | + }; | ||
380 | + }); | ||
381 | + | ||
382 | + const data = naver2017.filter(m => m.title); | ||
383 | + allWebtoonList3.push(data); | ||
384 | + //console.log(allWebtoonList3) | ||
385 | + } | ||
386 | + }, (error) => console.log(error)); | ||
387 | + | ||
388 | + //2016년 연재 네이버 웹툰 | ||
389 | + const naver2016 = 'https://comic.naver.com/webtoon/period.nhn?period=2016'; | ||
390 | + | ||
391 | + axios.get(naver2016).then(res => { | ||
392 | + if (res.status === 200) { | ||
393 | + let naver2016 = []; | ||
394 | + const $ = cheerio.load(res.data); | ||
395 | + const $toonList = $('#content > div.list_area.daily_img > ul > li'); | ||
396 | + var tn = 2016; | ||
397 | + $toonList.each(function (i) { | ||
398 | + naver2016[i] = { | ||
399 | + title: $(this).find('dl > dt > a').text(), | ||
400 | + img: $(this).find('div > a > img').attr('src'), | ||
401 | + index: $(this).find('li > div > a').attr('href'), | ||
402 | + year : tn | ||
403 | + }; | ||
404 | + }); | ||
405 | + | ||
406 | + const data = naver2016.filter(m => m.title); | ||
407 | + allWebtoonList3.push(data); | ||
408 | + //console.log(allWebtoonList3) | ||
409 | + } | ||
410 | + }, (error) => console.log(error)); | ||
411 | + | ||
412 | + //2015년 연재 네이버 웹툰 | ||
413 | + const naver2015 = 'https://comic.naver.com/webtoon/period.nhn?period=2015'; | ||
414 | + | ||
415 | + axios.get(naver2015).then(res => { | ||
416 | + if (res.status === 200) { | ||
417 | + let naver2015 = []; | ||
418 | + const $ = cheerio.load(res.data); | ||
419 | + const $toonList = $('#content > div.list_area.daily_img > ul > li'); | ||
420 | + var tn = 2015; | ||
421 | + $toonList.each(function (i) { | ||
422 | + naver2015[i] = { | ||
423 | + title: $(this).find('dl > dt > a').text(), | ||
424 | + img: $(this).find('div > a > img').attr('src'), | ||
425 | + index: $(this).find('li > div > a').attr('href'), | ||
426 | + year : tn | ||
427 | + }; | ||
428 | + }); | ||
429 | + | ||
430 | + const data = naver2015.filter(m => m.title); | ||
431 | + allWebtoonList3.push(data); | ||
432 | + //console.log(allWebtoonList3) | ||
433 | + } | ||
434 | + }, (error) => console.log(error)); | ||
435 | + | ||
340 | allWebtoons3 = allWebtoonList3; | 436 | allWebtoons3 = allWebtoonList3; |
341 | } | 437 | } |
342 | 438 | ... | ... |
-
Please register or login to post a comment