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

168
Views
Playwright waitForResponse as I evaluate page

I am trying to intercept XHR resources as I lazyload content with Playwright.

I am using this, which works well the first time.

const content = await page.waitForResponse((response) =>
  response.url().includes('somedata.json')
)

const { data } = await content.json()

The problem is that when I lazyload the content by scrolling, it always gets the same content and does not load the new somedata.json that gets generated as I keep scrolling.

const results = await page.evaluate(async (data) => {
  let arr = []

  for (let i = 0; i < document.body.scrollHeight; i += 100) {
    arr.push(...Object.values(data))
    window.scrollTo(0, i)
  }

  return arr
}, data)

Is there a way to trigger a new interception inside page.evaluate?

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!