Skip to content

Instantly share code, notes, and snippets.

@tvanantwerp
Created November 28, 2020 17:13
Show Gist options
  • Save tvanantwerp/bef370220bbb7c1630fc11928105b3d1 to your computer and use it in GitHub Desktop.
Save tvanantwerp/bef370220bbb7c1630fc11928105b3d1 to your computer and use it in GitHub Desktop.
Get name and instructor of course listings on Udemy courses page
// for use in console here: https://www.udemy.com/home/my-courses/learning/
// last used successfully on 11/28/2020
let courseObjs = Array.from(document.querySelectorAll('a.card--learning__details'))
let theCourses = [];
courseObjs.forEach(obj => theCourses.push({
title: obj.querySelector('strong.details__name').textContent,
author: obj.querySelector('div.details__instructor').textContent
})
)
console.table(theCourses);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment