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

154
Views
Get main content in a page while web scraping node js, Puppeteer, Cheerio

I have a Project with Node JS on web scraping where I will have to scrape Heading and Text from Main Content. But the Problem is I'm not able to Determine which is Main Content When there is No aside or main tag or class/id/role named aside or main. I'm Using Puppeteer and Cheerio Library. I have Tried using Mercury Web Parser But it has its Own problems. Like It doesn't return any content from Pages that Built with Elementor Theme builder on Wordpress. If anyone have any idea on how can I differentiate main content from rest of the web page it will be really helpful.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can checkout Readability JS library from Mozilla. They use for reader view.

about 4 years ago · Juan Pablo Isaza Report

0

Try to explore more about CSS Selectors and specificity.
If you're scraping Elementor, be sure to use this trick for the selector: Use data-elementor-(attributename) attributes for everything in DOM.

const mainContent = await page.waitForElement('[data-elementor-type="wp-page"]', {visible: true, timeout: 0})
about 4 years ago · Juan Pablo Isaza Report
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!