Need script for listing "Enrolled" course of Udemy in Excel sheet

  • I have more than approx. 600 course enrolled on Udemy, it is very pain to browse my courses, since Udemy shows only 12 course per page therefore I have to browse more than 50 page to see all the course I have, I messaged Udemy but they are not responding to my request, I’m sure many people are facing this issues.
  • I want to list all my enrolled course of Udemy account so that I can planned my studies according to my available recourses, since sometimes I forget I already have course that I have to learn.
  • I’m amateur programmer, I had made the script to get the title, video content length, rating, and no of user enrolled tag to sort the best course for me to start learning and export them to excel, but problem is I get stuck in pagination.

Can anyone help/provide me the Python/JavaScript script to list all the enrolled course of Udemy in single Excel sheet.

6 Likes

thanks for the updates here

1 Like

  1. Click the lock icon in chrome

  2. Click on cookies

  3. Click on www.udemy.com

  4. Click on cookies

  5. click on access token

  6. copy the access token (double click on it and then right mouse button and copy)[higlighted in yellow] Download the script here

  7. In the script on line 5 there is a variable named access_token so paste the access token which you copied earlier

  8. A csv file will be generated

  9. Go to the website and upload the csv file it will generate excel file for you.

  10. Done :smile:

20 Likes

is it a batch file or python file? how to execute the script?

Python file . To execute python file check some YouTube videos I am not gonaa teach here.

1 Like

wow thank you @pankaj260

Traceback (most recent call last):
File “C:\Users\Username\OneDrive\Desktop\udemy.py”, line 1, in
import requests
ModuleNotFoundError: No module named ‘requests’

pip install requests

Thanks for your share. Your script is working nice. I tried 2 times it’s import 201 courses from 1000 courses enrolled. Showing following ERROR


Traceback (most recent call last):
File “E:\Wp-Projects#3-WebTools\Udemy-CL\udemy.py”, line 39, in
writer.writerow([courseName, courseUrl])
File “C:\Python\Python38\lib\encodings\cp1252.py”, line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: ‘charmap’ codec can’t encode characters in position 12-15: character maps to

Need your kind help. I need whole list of enrolled courses.
P.S. I am using " Python 3.8.1"

Regards

I have updated the script please download the latest script and please inform if it works .

alternatively you can paste whole script on google colab notebook and run there

Can you add column for ‘Rating’ and ‘course length’ in the script?

I’m working on some other project if i get time i will add .

Hey can u tell from where you get the documentatioin for the Udemy’s API? I searched for it and https://www.udemy.com/developers/affiliate/ one does not seem to mention the paths that you have accessed from your code.

1 Like

Hey, Thanks a lot. Your revised script work great. :smiley:

I modified the code to get many features of the course in csv file title, author, rating, length, last_update, badge.
Thank you @pankaj260 for giving ray of hope.

cmd/terminal:

  1. Download the folder and navigate to file in folder in cmd/terminal

  2. run:
    pip install -r requirements.txt

  3. run:
    python udemyEnrolled.py

  4. Paste the access_token of Udemy

or
jupyter/colab:

open python notebook and follow the flow.

note: some data are not available, because of Udemy’s new page design please feel free to modify the code according to your need.
edit: fix minor bugs

8 Likes

@Saitama Excellent script.Works just fine.But you made a small typo in your code. You saved the txt file as req.txt but in code you accessed requirements.txt. Hope you fix it. Great work.

1 Like

I tried, but its stuck up at this :

Traceback (most recent call last):
File “C:\udemy enrolled_terminal\udemy_enrolled_list.py”, line 64, in
author = soup.find(‘a’, attrs={‘class’:‘instructor-links__link’}).contents[0][1:]
AttributeError: ‘NoneType’ object has no attribute ‘contents’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\udemy enrolled_terminal\udemy_enrolled_list.py”, line 66, in
author = soup.find(‘div’, attrs={‘data-purpose’:‘instructor-name-top’}).find(‘span’).find(‘a’).contents[0]
AttributeError: ‘NoneType’ object has no attribute ‘find’

1 Like

the code got old need to update