Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

90
Views
How can I get all children element rather than first few of the children using Cheerio?

I am trying to scrape the gig titles but it's only giving me the first 7-8 titles where it should be like 48 titles. When Checking the issue, I noticed I am not getting all children elements from the gig container. It's only giving the first 8 of the children. After checking on the website, I could see when I opened the page, It returns 8 of the gigs container first, and then after a second, the rest of the gigs container loads.

If that's the issue, how can I get the all-children element?

Here is the code:

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

async function getGigObjects(proURL) {
    try {
        const url = proURL;
        const { data } = await axios({
            method: "GET",
            url: url,
            headers: {
                "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Edg/94.0.992.38"
            }
        })


        let $ = cheerio.load(data)
        const queryDa = '#perseus-app > div > div > div.layout-row.content-row > div > div > div > div'

        const gigContainerData = []
        $(queryDa).each((parentIdx, parentElem) => {
            $(parentElem).children().children().children('.text-display-7').children().each((childIdx, childElem) => {
                console.log($(childElem).text())
                    
            })
        })
        return gigContainerData

        
    } catch (err) {
        console.log(err)
    }
}


app.get('/home', async function (req, res) {
    const getGigData = await getGigObjects('https://www.fiverr.com/categories/programming-tech/wordpress-services')

    console.log('Inside Home Login');
    res.writeHead(200, {
        'Content-Type': 'application/json',
    });
    res.end(JSON.stringify(getGigData));
});


app.listen(3001, () => {
    console.log('Server Listening on port 3001');
});

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!