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

460
Views
Puppeteer: Some of the images are not loading properly

I am trying to parse a webpage everything is working fine but some of the images are getting broken.

enter image description here

i tried everything but got no luck here is my code

const browser = await puppeteer.launch({
    args: [
        "--no-sandbox",
    ],
  });
  const page = await browser.newPage();
  await page.setViewport({ width: 1440, height: 10000 })
  await page.goto(url, {
        waitUntil: 'networkidle2',
        timeout: 0,
  });

await page.evaluate(() => {
const images = document.getElementsByTagName('img') || []
    for (let i = 0; i < images.length; i++) {
        document.getElementsByTagName('img')[i].src = document.getElementsByTagName('img')[i].getAttribute('src')?.startsWith('https') ?
        document.getElementsByTagName('img')[i].getAttribute('src')! :
        `https://leza.notion.site${document.getElementsByTagName('img')[i].getAttribute('src')}`
    }
})

Here is the actual website which i am trying to parse https://leza.notion.site/Trade-log-721b1ebb4cc74175abb55408b6f2d0c3

Any help would be highly appreciated

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!