Detect multiple items on a webpage

I have a code that serves as a kind of Instagram "API" to download posts. It uses axios to connect to downloadgram.com, make a request with the past url, find the download button, and deliver the direct link from Instagram servers to that post.

It works great, but the biggest problem is that it only downloads the first item. For example: if it's a single image/video inside the post, ok, it downloaded correctly. but now if it's a post with several photos or images, it only downloads the first one.

I would like to know how I can make it find the other download buttons ('#downloadBox''), because it only takes the first one.

Thanks in advance.

const axios = require('axios');
const cheerio = require('cheerio');

async function igDl(Link) {
    const hasil = []
    const Form = {
        url: Link,
        submit: ""
    }
    await axios(`https://downloadgram.org/`, {
        method: "POST",
        data:  new URLSearchParams(Object.entries(Form)),
        headers: {
            "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
            "accept-language": "en-US,en;q=0.9,id;q=0.8",
            "cache-control": "max-age=0",
            "content-type": "application/x-www-form-urlencoded",
            "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"",
            "cookie": "_ga=GA1.2.1695343126.1621491858; _gid=GA1.2.28178724.1621491859; __gads=ID=8f9d3ef930e9a07b-2258e672bec80081:T=1621491859:RT=1621491859:S=ALNI_MbqLxhztDiYZttJFX2SkvYei6uGOw; __atuvc=3%7C20; __atuvs=60a6eb107a17dd75000; __atssc=google%3B2; _gat_gtag_UA_142480840_1=1"
        },
        referrerPolicy: "strict-origin-when-cross-origin",
    }).then(async res => {
        const $ = cheerio.load(res.data)
        let url = $('#downloadBox').findall('a').attr('href');
        await axios(Link, {
            method: "GET",
            data: null,
            headers: {
                "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                "accept-language": "en-US,en;q=0.9,id;q=0.8",
                "cache-control": "max-age=0",
                "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"90\", \"Google Chrome\";v=\"90\"",
                "cookie": "ig_did=08A3C465-7D43-4D8A-806A-88F98384E63B; ig_nrcb=1; mid=X_ipMwALAAFgQ7AftbrkhIDIdXJ8; fbm_124024574287414=base_domain=.instagram.com; shbid=17905; ds_user_id=14221286336; csrftoken=fXHAj5U3mcJihQEyVXfyCzcg46lHx7QD; sessionid=14221286336%3A5n4czHpQ0GRzlq%3A28; shbts=1621491639.7673564; rur=FTW"
            },
            referrerPolicy: "strict-origin-when-cross-origin"
        }).then(respon => {
            const ch = cheerio.load(respon.data)
            let title = ch('title').text().trim()
            const result = {
                status: true,
                result: {
                    link: url,
                    desc: title
                }
            }
            hasil.push(result)
        })
    })
    return hasil[0]
}
module.exports = { igDl }
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum