김동근

work well original ver.

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