김동근

work well original ver.

...@@ -11,7 +11,7 @@ exports.AddCards=(deckId,cards)=>{ ...@@ -11,7 +11,7 @@ exports.AddCards=(deckId,cards)=>{
11 11
12 return new Promise((resolve,reject)=>{ 12 return new Promise((resolve,reject)=>{
13 //전체 카드 읽어 오기 13 //전체 카드 읽어 오기
14 - fs.readFile('cardsenUS.json',(err,data)=>{ 14 + fs.readFile('cardsenUS2.json',(err,data)=>{
15 if (err) throw err 15 if (err) throw err
16 cardEnUS=JSON.parse(data) 16 cardEnUS=JSON.parse(data)
17 //mysql 연결 17 //mysql 연결
......
...@@ -34,8 +34,10 @@ exports.GetResult=(req,res)=>{ ...@@ -34,8 +34,10 @@ exports.GetResult=(req,res)=>{
34 cardIds=JSON.parse(cardIds) 34 cardIds=JSON.parse(cardIds)
35 //검색을 위한 쿼리스트링 35 //검색을 위한 쿼리스트링
36 let idInQuery=cardIds[0].cardId 36 let idInQuery=cardIds[0].cardId
37 - for(let i=1;i<cardIds.length ;i++){ 37 + //cardIds.length
38 - idInQuery+= '%2C'+cardIds[i].cardId 38 + for(let i=1;i< cardIds.length;i++){
39 + if(cardIds[i].cardId != '0')
40 + idInQuery+= '%2C'+cardIds[i].cardId
39 } 41 }
40 //var url = 'https://hsreplay.net/decks/#timeRange=LAST_30_DAYS&includedCards=' + idInQuery 42 //var url = 'https://hsreplay.net/decks/#timeRange=LAST_30_DAYS&includedCards=' + idInQuery
41 43
...@@ -51,7 +53,8 @@ exports.GetResult=(req,res)=>{ ...@@ -51,7 +53,8 @@ exports.GetResult=(req,res)=>{
51 const page=await browser.newPage() 53 const page=await browser.newPage()
52 await page.setViewport({width:1366,height:768}) 54 await page.setViewport({width:1366,height:768})
53 //idInQuery = '180%2C48886%2C904%2C461' 55 //idInQuery = '180%2C48886%2C904%2C461'
54 - await page.goto(`https://hsreplay.net/decks/#timeRange=LAST_30_DAYS&includedCards=${idInQuery}`,{waitUntil: 'load'}) 56 + console.log(idInQuery)
57 + await page.goto(`https://hsreplay.net/decks/#timeRange=LAST_30_DAYS&includedCards=${idInQuery}`,{waitUntil: 'networkidle2'})
55 const content=await page.content() 58 const content=await page.content()
56 browser.close() 59 browser.close()
57 return content 60 return content
......
This diff could not be displayed because it is too large.