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

164
Vistas
Trigger some JavaScript function with selenium on a webpage to load new elements

I'm trying to get some data from a webpage:

https://www.cabotcorp.com/solutions#product-index

On this webpage, whenever you scroll down to the end, it takes a couple of seconds and then loads a new set of items.

When that happens something gets added to the HTML which I want to look at with selenium in python.

So my question is pretty general:

Is there a way to force the function that loads the new elements?

My first idea is as follows:

driver.execute_script("arguments[0].scrollIntoView();", driver.find_element(By.CLASS_NAME, "some class at the bottom of the page"))

This is the code I would use to let selenium scroll down to some element on the webpage. After that I would just sleep for a set amount of time to assure that the new elements loaded in.

However, I noticed that this webpage uses "ddscrollspy"

https://github.com/dynamicdriverepo/ddscrollspy

Is there a way to use selenium to trigger a new set of items? I'm basically looking for a function that triggers certain Javascripts that are available on a certain webpage.

Edit:

A friend suggested looking for triggers:

This is what I found in Chrome:

enter image description here

So I now have access to the code that gets executed whenever something new loads. Now I just need to know how to trigger that code on demand.

Thanks for the help.

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