Skip to content

Instantly share code, notes, and snippets.

@yagopajarino
Created March 6, 2024 20:09
Show Gist options
  • Save yagopajarino/3b8f3b3233ee78363b65781caf114b17 to your computer and use it in GitHub Desktop.
Save yagopajarino/3b8f3b3233ee78363b65781caf114b17 to your computer and use it in GitHub Desktop.
/* Extrae curricula del curso de Udemy
Ejecutar en la consola de chrome dentro de la pagina de inicio del curso
06-03-2024
Creado por Yago Pajariño ([email protected])
*/
let curricula = document.querySelector('div[data-purpose="course-curriculum"]');
let contenedorCurso = curricula.lastElementChild
let lis = new Array(...contenedorCurso.querySelectorAll("li"))
const extractDataFromLi = (li) =>{
let row = li.querySelector(".ud-block-list-item-content")
let title = row.querySelector(".section--item-title--EWIuI").textContent
let tiempo = row.querySelector('.section--hidden-on-mobile---ITMr.section--item-content-summary--Aq9em').textContent;
return [title, tiempo].join(";")
}
console.log(lis.map(i => extractDataFromLi(i)).join("\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment