Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
Sending an xhr/fetch request with puppeteer

I'm working with puppeteer and trying to send an xhr requesr after login. Using devtools network tab, I copied the request of interest using the fetch api option. I wrapped it in the page.evaluate function as below:

let x = await page.evaluate((SecureAuthToken) => {
  return fetch("/api/Search/PropertySearch", {
    headers: {
      "accept": "application/json, text/plain, */*",
      "accept-language": "en-US,en;q=0.9",
      "content-type": "application/json;charset=UTF-8",
      "sec-ch-ua":
        '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',
      "sec-ch-ua-mobile": "?0",
      "sec-ch-ua-platform": '"Chrome OS"',
      "sec-fetch-dest": "empty",
      "sec-fetch-mode": "cors",
      "sec-fetch-site": "same-origin",
      "secureauthtoken": SecureAuthToken,
    },
    referrerPolicy: "no-referrer",
    body: '{"Filters":[{"FieldId":9,"BundleChildren":.....}',
    method: "POST",
    mode: "cors",
    credentials: "include",
  });
},SecureAuthToken);

I'm passing in the SecureAuthToken. when I do

console.log(x)

The result is

[]

What am I doing wrong? Also is there a good way to debug this?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda