Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

61
Views
cheerio not picking up particular elements

Hi trying to use cheerio to scrape this https://davesgarden.com/guides/pf/finder/index.php?sname=Hibiscus&page=1 , and can access some elements such as the menu items, but not the plant names which i need. Im using this code to try get the plant names

const $ = cheerio.load(data);

$('#contAfterAds > div > div.plant-info > div > a').each((_idx, el) => {
            const postTitle = $(el).text()
            postTitles.push(postTitle)
        });

but no luck, any suggestions? Ive seen that angular sites cant be scraped, could it be a similar problem?

7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

It's a sibling:

$(el).next().text()

or possibly:

$(el).next().next().text()
7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs