은승우

Update app.js

Showing 1 changed file with 1 additions and 3 deletions
......@@ -100,15 +100,13 @@ async function handleEvent(event) {
request.post(options, function (error, response, body) {
let jsonResponse = JSON.stringify(JSON.parse(body), null, ' ');
console.log(jsonResponse);
var text='';
while(jsonResponse.indexOf('text\\')!=-1)
{
data=data.substring(data.indexOf('text\\')+9);
text+=data.substring(0,data.indexOf("\\"))+" ";
}
console.log(text);
var url="https://www.genie.co.kr/search/searchLyrics?query="+ encodeURI(text);
console.log(url);
request(url, function(error, response, html){
var $ = cheerio.load(html);
const $bodyList= $('#body-content > div.search_lyrics > div.music-list-wrap.type-lyrics > table > tbody > tr');
......