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

204
Vistas
Inject javascript fetch and XHR into Selenium with Python

There are several ways to scrape information from websites. Recently I've heard that you can open a selenium webdriver and inject JS on it to fetch specific url from within the website or to replicate AJAX calls.

For example

driver.execute_script("return fetch('www.yoururlhere')")

So, I have a couple of questions regarding it

1 - How do you actually fetch the answer? Inspecting the driver I can see the call but neither in the frontpage nor doing driver.page_source am I able to retrieve it.

2 - How would one replicate more complex requests calls where there is params or data?

requests.get(url=url,headers=headers,params=params)
requests.post(url=url,headers=headers, data=json.loads(data))

How does this work?

Thanks!

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