Table of Contents
Overview
This should be an Udemy feature where people can search through video titles AND transcripts.
Sadly such features are not available.
I’m considering making a browser extension for this but for now, this is a quick hack.
How to print all sections’ titles
To print all the sections’ titles, type the following in the console:
document.querySelectorAll('.udlite-accordion-panel-heading').forEach(t => console.log(t.innerText))
This is the result:
You can create a variable and append them and log the final result, however, this works for me.
Print the Udemy course’s videos’ titles
To print the videos’ titles, first, you need to expand all the sections.
Then, paste this code into the console:
document.querySelectorAll('.ud-accordion-panel-content').forEach(list => { console.log('------------'); list.querySelectorAll('li [data-purpose="item-title"]').forEach(l1 => { console.log(l1.innerText); }); });
Then you’ll have the following result:
There you have it, all the titles in the console. Again, you can get creative for all the pretty print but these snippets give you all the titles you need.
I hope that helps. Now let’s go learn something new.
I build softwares that solve problems. I also love writing/documenting things I learn/want to learn.