Showing
1 changed file
with
17 additions
and
0 deletions
... | @@ -32,5 +32,22 @@ module.exports = { | ... | @@ -32,5 +32,22 @@ module.exports = { |
32 | .setLabel("현재 마리샵 정보 조회") | 32 | .setLabel("현재 마리샵 정보 조회") |
33 | .setStyle("SECONDARY") | 33 | .setStyle("SECONDARY") |
34 | ); | 34 | ); |
35 | + async function getHTML() { | ||
36 | + try { | ||
37 | + return await axios.get("https://lostark.game.onstove.com/Shop#mari"); | ||
38 | + } catch (error) { | ||
39 | + console.error(error); | ||
40 | + } | ||
41 | + }; | ||
42 | + await getHTML().then(html => { | ||
43 | + const $ = cheerio.load(html.data); | ||
44 | + const bodyList = $("ul.list-items").children("li"); | ||
45 | + bodyList.each(function(i, elem) { | ||
46 | + itemInfo[i] = { | ||
47 | + name: $(this).find("span.item-name").text(), | ||
48 | + amount: $(this).find("span.amount").text()}; | ||
49 | + }); | ||
50 | + return itemInfo; | ||
51 | + }); | ||
35 | }, | 52 | }, |
36 | }; | 53 | }; |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment