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

**URL:** <https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [April 28, 2020, 11:35am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081 "2020-04-28T11:35:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [April 28, 2020, 11:35am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/1 "2020-04-28T11:35:01Z")

</div>

- 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.

---

<div class="post-metadata">

**Author:** ![Omi\_Ir](https://onehack.st/user_avatar/onehack.st/omi_ir/32/18065_2.png) [@Omi\_Ir](https://onehack.st/u/Omi_Ir)\
**Post date:** [April 28, 2020, 12:45pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/2 "2020-04-28T12:45:40Z")

</div>

thanks for the updates here

---

<div class="post-metadata">

**Author:** ![pankaj260](https://onehack.st/user_avatar/onehack.st/pankaj260/32/18769_2.png) [@pankaj260](https://onehack.st/u/pankaj260)\
**Post date:** [April 28, 2020, 8:11pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/3 "2020-04-28T20:11:08Z")

</div>

![Capture1](https://onehack.st/uploads/default/original/3X/7/8/78ce71231d7d8b2954363d6ba298b38d744304f1.png)

1. Click the lock icon in chrome

2. Click on cookies  

3. Click on [www.udemy.com](http://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](https://www.dropbox.com/s/ghfvqlth7m4lkjs/udemy.py?dl=0)

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](https://www.convertcsv.com/csv-viewer-editor.htm) and upload the csv file it will generate excel file for you.

10. Done 😄

---

<div class="post-metadata">

**Author:** ![Nabeel\_Imran](https://onehack.st/user_avatar/onehack.st/nabeel_imran/32/16728_2.png) [@Nabeel\_Imran](https://onehack.st/u/Nabeel_Imran)\
**Post date:** [April 29, 2020, 3:12am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/4 "2020-04-29T03:12:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pankaj260](https://onehack.st/user_avatar/onehack.st/pankaj260/32/18769_2.png) [@pankaj260](https://onehack.st/u/pankaj260)\
**Post date:** [April 29, 2020, 3:55am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/5 "2020-04-29T03:55:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [April 29, 2020, 4:58am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/6 "2020-04-29T04:58:37Z")

</div>

wow thank you @pankaj260

---

<div class="post-metadata">

**Author:** ![WEBD](https://onehack.st/user_avatar/onehack.st/webd/32/117499_2.png) [@WEBD](https://onehack.st/u/WEBD)\
**Post date:** [April 30, 2020, 8:07am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/9 "2020-04-30T08:07:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pankaj260](https://onehack.st/user_avatar/onehack.st/pankaj260/32/18769_2.png) [@pankaj260](https://onehack.st/u/pankaj260)\
**Post date:** [April 30, 2020, 10:59am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/10 "2020-04-30T10:59:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [May 1, 2020, 3:21am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/12 "2020-05-01T03:21:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pankaj260](https://onehack.st/user_avatar/onehack.st/pankaj260/32/18769_2.png) [@pankaj260](https://onehack.st/u/pankaj260)\
**Post date:** [May 1, 2020, 10:22am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/13 "2020-05-01T10:22:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Yash](https://onehack.st/user_avatar/onehack.st/yash/32/40507_2.png) [@Yash](https://onehack.st/u/Yash)\
**Post date:** [May 1, 2020, 10:34am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/14 "2020-05-01T10:34:41Z")

</div>

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/](https://www.udemy.com/developers/affiliate/) one does not seem to mention the paths that you have accessed from your code.

---

<div class="post-metadata">

**Author:** ![dydx](https://onehack.st/user_avatar/onehack.st/dydx/32/36729_2.png) [@dydx](https://onehack.st/u/dydx)\
**Post date:** [May 1, 2020, 3:35pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/15 "2020-05-01T15:35:19Z")

</div>

![s1](https://onehack.st/uploads/default/original/3X/3/d/3d161d68234e89b37f5c31ad0e4c8e4129652fdc.png) ![s2](https://onehack.st/uploads/default/original/3X/9/a/9a4748cac67788892408dad172c133da0ebdce11.png) ![s3](https://onehack.st/uploads/default/original/3X/b/b/bbb1fabb145c947b5d9cac1a5afdf74da8a298ee.png)

---

<div class="post-metadata">

**Author:** ![WEBD](https://onehack.st/user_avatar/onehack.st/webd/32/117499_2.png) [@WEBD](https://onehack.st/u/WEBD)\
**Post date:** [May 1, 2020, 5:40pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/16 "2020-05-01T17:40:37Z")

</div>

Hey, Thanks a lot. Your revised script work great. 😃

---

<div class="post-metadata">

**Author:** ![techiemax8](https://onehack.st/user_avatar/onehack.st/techiemax8/32/10065_2.png) [@techiemax8](https://onehack.st/u/techiemax8)\
**Post date:** [April 29, 2020, 7:24pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/7 "2020-04-29T19:24:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [April 29, 2020, 8:26pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/8 "2020-04-29T20:26:21Z")

</div>

pip install requests

---

<div class="post-metadata">

**Author:** ![Nabeel\_Imran](https://onehack.st/user_avatar/onehack.st/nabeel_imran/32/16728_2.png) [@Nabeel\_Imran](https://onehack.st/u/Nabeel_Imran)\
**Post date:** [May 1, 2020, 1:39am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/11 "2020-05-01T01:39:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [May 1, 2020, 9:27pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/17 "2020-05-01T21:27:06Z")

</div>

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:

> **[Dropbox - Error - Simplify your life](https://www.dropbox.com/sh/hxh29lnkqvh0etf/AABFJpxrOtY9-tX0XWLLqnaea?dl=0)**

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:

> **[Dropbox - Error - Simplify your life](https://www.dropbox.com/sh/ir5uyobq4vortst/AACubFJk3ESZfVaBDLSIyyMRa?dl=0)**

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

---

<div class="post-metadata">

**Author:** ![sayeed\_hasan](https://onehack.st/user_avatar/onehack.st/sayeed_hasan/32/19361_2.png) [@sayeed\_hasan](https://onehack.st/u/sayeed_hasan)\
**Post date:** [May 16, 2020, 5:57pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/18 "2020-05-16T17:57:33Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![acerx2684](https://onehack.st/user_avatar/onehack.st/acerx2684/32/8831_2.png) [@acerx2684](https://onehack.st/u/acerx2684)\
**Post date:** [June 9, 2020, 6:17pm UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/19 "2020-06-09T18:17:07Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![Saitama](https://onehack.st/user_avatar/onehack.st/saitama/32/38608_2.png) [@Saitama](https://onehack.st/u/Saitama)\
**Post date:** [June 10, 2020, 5:13am UTC](https://onehack.st/t/need-script-for-listing-enrolled-course-of-udemy-in-excel-sheet/83081/20 "2020-06-10T05:13:17Z")

</div>

the code got old need to update
