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

106
Vistas
List all innerText contents of a TagName that is dynamically created while scrolling through Youtube

I'm working on a Javascript project while learning, and my objective is to retrieve the titles of all the videos on my Youtube Homepage, along with the titles which get dynamically added while scrolling.

I was able to list the innerText of a particular tag which contained titles of all the initially loaded videos along with some additional data using this simple code : (I'm planning to extract the titles from the string obtained)

var videos = document.getElementsByTagName("ytd-rich-item-renderer"); // This is dynamic (n elements)

for(i of videos){
  console.log(i.innerText)
}

However, the result obtained is limited to a few videos and does not update when a new set of videos get loaded (while scrolling). I believe Youtube renders/loads videos through Grids. So every time I reach the end of an initial set of videos (that loads on every refresh), it fetches for videos, and new grids are dynamically added.

The <ytd-rich-item-renderer> tag element gets dynamically added for every new loaded video. The parent component of every <ytd-rich-item-renderer> tag element is <ytd-rich-grid-renderer> :

document.getElementsByTagName("ytd-rich-item-renderer")[0].parentComponent
Output : <ytd-rich-grid-renderer class="style-scope ytd-two-column-browse-results-renderer" full-bleed="" style="--ytd-rich-grid-items-pe…-slim-items-per-row: 9;">

How can I modify this code to get a list of all <ytd-rich-item-renderer> elements that were being added dynamically in real-time while scrolling? (My end-goal is to create an extension)

Thanks in Advance!

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