IonicaBizau / scrape-it

🔮 A Node.js scraper for humans.

Home Page:http://ionicabizau.net/blog/30-how-to-write-a-web-scraper-in-node-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to get listitems. (Newbie)

ChakshuGautam opened this issue · comments

Unable to get listitems; It returns an empty array every time.

const baseURL = `https://swayam.gov.in/explorer`;
scrapeIt(`${baseURL}`, {
        courses: {
            listItem: ".shadowBox.course-card",
            data: {
                 courseName: {
                     selector: "h4 > a:nth-child(2)",
                     attr: "title"
                 }               
            }
        },
    }).then(({ data, response }) => {
        console.log(`Status Code: ${response.statusCode}`);
        console.log(data);
    })

What is the html you are scraping?

Please ask questions on Stackoverflow.