// loop through the udemy elements var wholeList = document.getElementsByClassName('card--learning__details') for (let item = 0; item < wholeList.length; item++) { const element = wholeList[item]; const courseLink = element.href const courseName = element.children[0].children[0].innerText console.log(courseName, '###' , courseLink) }