Skip to content

Commit

Permalink
menu link 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
martinuslee committed Mar 15, 2021
1 parent 78111f1 commit cf3f866
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions router/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const express = require("express");
const apiRouter = express.Router();
const axios = require("axios"); //html로 웹자료를 get
const cheerio = require("cheerio"); //html을 JS로 변환
let $href = [];

apiRouter.post("/menu", function (req, res) {
console.log(req.body);

let $href = [];
axios
.get(`https://sejong.korea.ac.kr/campuslife/facilities/dining/weeklymenu`)
.then((response) => {
Expand All @@ -18,7 +18,7 @@ apiRouter.post("/menu", function (req, res) {
$(links).each((i, link) => {
//console.log(i + ' : ' + $(link).text() +': '+$(link).attr('href')+ '\n');
if ($(link).text() === "교직원식당 주간 메뉴")
$href.push($(link).attr("href"));
$href=($(link).attr("href"));
});
console.log("https://sejong.korea.ac.kr" + $href);
});
Expand Down

0 comments on commit cf3f866

Please sign in to comment.