SUJINKO(고수진)

Replace index.js

var express = require('express');
var router = express.Router();
const axios = require("axios");
//읽어온 정보를 html로직으로 변환하여 화면작업을 하도록 유도합니다
const cheerio = require('cheerio');
router.get('/', function(req, res, next) {
let url = 'https://www.yna.co.kr/sports/all';
let url = 'https://www.koreanair.com/korea/ko/2020_02_TSA_detail.html#par_titledparsys';
axios.get(url).then(html => {
let ulList = [];
......@@ -15,12 +14,9 @@ router.get('/', function(req, res, next) {
$bodyList.each(function(i, elem) {
ulList[i] = {
//find : 해당 태그가 있으면 그 요소 반환
title: $(this).find('strong.news-tl a').text(),
url: $(this).find('strong.news-tl a').attr('href'),
image_url: $(this).find('p.poto a img').attr('src'),
image_alt: $(this).find('p.poto a img').attr('alt'),
summary: $(this).find('p.lead').text().slice(0, -11),
date: $(this).find('span.p-time').text()
country: $(this).find('th_row_style').text(),
condition: $(this).find('').text(),
etc: $(this).find('').text()
};
});
......