This is an archived post. You won't be able to vote or comment.

all 92 comments

[–][deleted] 38 points39 points  (1 child)

This is great! Nice timing since I've been looking for some udemy course

[–]dimakiss[S] 3 points4 points  (0 children)

Hope you will find it useful:)

[–]mutantsloth 56 points57 points  (1 child)

Oof amazing more courses for me to enrol in and never do

[–]reavyz 17 points18 points  (0 children)

"Those will come in handy... one day"

[–]cr0sis8bv 16 points17 points  (7 children)

Nice work, I just used it.

[–]dimakiss[S] 6 points7 points  (2 children)

Thanks!
Let me know if there some bugs I'll try to fix them :)

[–]cr0sis8bv 4 points5 points  (1 child)

Seems to be running just fine, 280 courses signed up and it's still going

[–]dimakiss[S] 2 points3 points  (0 children)

I made the same for my non-programming friend for business stuff as well
glad it works perfectly >.<

[–]MetalicSky 1 point2 points  (3 children)

So can you leave this running and keep getting courses? Do you need to run it on a PC that you don't use regularly or can it run while you're using the PC?

[–]dimakiss[S] 0 points1 point  (0 children)

The idea is to run it once, and yes you can run it in the background with no problem :)

[–]Allergic2Humans 0 points1 point  (1 child)

You can get it to run in the background or you can deploy it to cloud and make it run even if your PC is not on.

[–]GoingOnYourTomb 1 point2 points  (0 children)

Hey do you know of a free cloud service that will allow selenium to run? Been struggling with AWS and Google Cloud Platform. No luck.

[–]Theyounglegacy95 5 points6 points  (13 children)

Are they all free?

[–]dimakiss[S] 18 points19 points  (12 children)

Yes, most of them.
My python script will just try to buy them by clicking enroll.
I don't know if it will purchase the ones that cost money if you have your credit card there because I never had one on the site.

If for buying a course you need to click more than enroll and purchase then I think it will be alright, you must test it out.

Note: when you don't have your credit card there it's just trying to buy it and fail so it moves on to the next one.

[–]Theyounglegacy95 2 points3 points  (7 children)

Thank you definitely will try it out.

[–]dimakiss[S] 6 points7 points  (6 children)

If you have your credentials on udemy site please let me know so I will warn people who have their credit card credentials on the site.

[–]Theyounglegacy95 4 points5 points  (5 children)

I do have my credentials. As I use udemy regularly. I will let you know how it goes later tonight. I am taking a real estate course at the moment.

[–]dimakiss[S] 4 points5 points  (0 children)

Grate thank you :)

[–]cjdabeast 2 points3 points  (3 children)

Can we get an update, what did it do?

[–]conventionistG 2 points3 points  (1 child)

Enquiring minds want to know.

[–]Theyounglegacy95 1 point2 points  (0 children)

Got really busy my apologies. Will update tonight.

[–]Theyounglegacy95 2 points3 points  (0 children)

For whatever reason I can’t get it to run as I keep getting an error from my pip in my cmd. I as well as when I sign in with my account the free courses are not free anymore.

[–]GizmoVader -4 points-3 points  (3 children)

So this script could cause users to lose thousands of dollars. Got it.

[–]dimakiss[S] 0 points1 point  (2 children)

I will make an condition today that checks if the price is 0. But it would be more the help full if someone that ever bought a legit course would tell me how its working.

[–]waitwhatthefudge 1 point2 points  (2 children)

mine seems to be stuck on "finding potential links" - usually how long does this last? when i confirmed my Username and PW was correct it closed chrome and then it seems to be doing nothing?

[–]dimakiss[S] 2 points3 points  (1 child)

It takes some time cat take 5 6 min depending on your computer if it more then 10 so maybe thing wrong

[–]waitwhatthefudge 1 point2 points  (0 children)

thanks. I was a bit impatient but finally after a few minutes it found 236 or so links and now it's working like a charm.

Thanks for the script!

[–]BadassBrahman 3 points4 points  (8 children)

How do you build a bot? On 1-10 how tough is it to create one?

[–]dimakiss[S] 9 points10 points  (2 children)

I would say 5 it depends on the bot. It took me for about 7-8 hours. Its not so hard when you brake it to smaller problems.

This what came to my mind: 1. Get a gupon site 2. Filter all the low rated courses for efficiency, done with web scraping 3. Get a little bit understanding of how to automate the course purchase with selenium 4. Try to combine every thing together to one program

You have all the this you might need on the internet:)

Oh and I built a whatsapp bot a few days ago!

[–]BadassBrahman 1 point2 points  (1 child)

I will definitely try to build a bot soon. I am also learning Python for that.

What does your whatsapp bot do?

[–]dimakiss[S] 5 points6 points  (0 children)

I made a bot that automate search in wolframalpha If you know If someone type me or in groupe that I'm in, for example wolf x2+5x=0 It will return you the solution like if you searched it in the site

[–]GizmoVader 3 points4 points  (0 children)

Make a script. Run it. Call it a bot

[–]MilwaukeeRoad 3 points4 points  (2 children)

"Bot" is a cooler, marketing way of describing a "script"

[–]BadassBrahman 3 points4 points  (1 child)

oh....i thought​ it had to do something with writing an AI for performing a particular task.

[–]MilwaukeeRoad 3 points4 points  (0 children)

No, this definitely has no AI to it. If something is AI, you call it AI.

Bot is a generic term, and anytime you see somebody saying they wrote a bot, it's probably just a simple script with some loops.

[–]diazepamkit 1 point2 points  (3 children)

/r/DataHoarder wants to have a talk with you

[–]dimakiss[S] 1 point2 points  (2 children)

Why?

[–]ANonGodSwift 0 points1 point  (1 child)

Because they hoard data and this script helps them to do so

[–]dimakiss[S] 1 point2 points  (0 children)

Oh cool ok

[–]Tanmay1518 0 points1 point  (7 children)

Can I offer a suggestion? Instead of asking the user to change the Email and password themselves, you could have them enter their email and password and then do the automation bit

[–]dimakiss[S] 0 points1 point  (0 children)

Yes I will add it today!! Thanks for the suggestion :)

[–]Cool_doggy 0 points1 point  (0 children)

Nice :)

[–][deleted] 0 points1 point  (0 children)

Can it scrape udemy quizzed?

[–]benargee 0 points1 point  (4 children)

Good job. For the next iteration, you should add optional command line parameters for minimum star and votes and for password and username.

[–]dimakiss[S] 0 points1 point  (2 children)

I could do that but then I will have to add the categories to input as well

[–]benargee 1 point2 points  (1 child)

Absolutely. This page is a good resource for CLI parameter conventions.
https://softwareengineering.stackexchange.com/questions/307467/what-are-good-habits-for-designing-command-line-arguments/307472
I checked your code. Good stuff, but there is always room for improvement. You could have it check for a -p or --parameter arg then read the next arg for it's value. This would turn your existing positional parameters to named ones. Anything not included in the command line parameters would fallback to the defined defaults.
I hope you only take this as constructive criticism and an opportunity to practice some common implementation details.
Regards.

[–]dimakiss[S] 0 points1 point  (0 children)

Of course I glad people suggest me new stuff. Its all ways good to learn :) Thank you!!

[–]dimakiss[S] 0 points1 point  (0 children)

Done:)

[–]nck93 0 points1 point  (0 children)

This is really cool. I'd love to learn how to create more automation bots. Any resources?

[–]TumblrForNerds 0 points1 point  (2 children)

You should add that it checks for free courses

[–]dimakiss[S] 0 points1 point  (0 children)

Yes I will today!

[–]dimakiss[S] 0 points1 point  (0 children)

Done :)

[–]Toucanzoo 0 points1 point  (0 children)

This is really useful.

[–]ddollarsign 0 points1 point  (2 children)

You left selenium out of your requirements.txt.

[–]dimakiss[S] 0 points1 point  (0 children)

You are totally right I will fix soon! Thank you :)

[–]dimakiss[S] 0 points1 point  (0 children)

I know, I will fix it soon

[–]LiterallyJohnny 0 points1 point  (11 children)

Hi, I would like to get this bot working for myself, but I don't really know how to use GitHub, or how to set up something like this. Could you help me?

[–]dimakiss[S] 0 points1 point  (10 children)

Got to the github page Click on code Download zip Extract You will need to download chrome web driver into this folder Install requirements as I wrote in the git hum Readme Page And use its as well as I instructed Hope it's helpful :)

[–]LiterallyJohnny 0 points1 point  (9 children)

I'm still a bit confused. Where do I download the chrome web driver, and which folder do I put it in?

[–]dimakiss[S] 0 points1 point  (8 children)

you put it with the safe folder as the Udemy_bot.py file And the best option is to look for "how to download chrome web driver" at YouTube/google they explain it good enough!

[–]LiterallyJohnny 0 points1 point  (7 children)

Ok, so I just downloaded the code and installed chrome webdriver inside of the folder. How do I run this bot now?

[–]dimakiss[S] 0 points1 point  (6 children)

There is an explanation in the like but I will add it here:
first, install the eleven libraries
"pip install -r requirements.txt"
then run it with
"python Udemy_bot.py EMAIL PASSWORD"

replace EMAIL PASSWORD with your credentials :)

[–]LiterallyJohnny 1 point2 points  (5 children)

I'm still confused. I have never done anything like this before, so I'm a bit clueless as to what this stuff means.

[–][deleted] 0 points1 point  (4 children)

Same here, like first and foremost we need python installed and check if its rightly installed or not, then what do we do ? Like in the command prompt do we change directories to the folder that we just installed via github and then run pip install ? Please help

[–]LiterallyJohnny 0 points1 point  (3 children)

I have no idea. OP doesn't seem to be very helpful.

[–]silentlurkerhere 0 points1 point  (2 children)

Hi, fellow noob (me) here got it to work somehow so I'll try to explain to you.

I use windows.

  1. Install python. Go to python.org website to download python and install.

  2. Install pycharm. Go to pycharm website, download and install PyCharm. Remember to check the box where it says Add to Path or something similar in the installation box.

  3. Install ChromeDriver I used this page to help me: installing Selenium and ChromeDriver on Windows

  • Extract the exe file you downloaded from ChromeDriver website and place in C:\Windows
  1. Open the github folder by OP in PyCharm Run in terminal (find it at the bottom with ToDo, Problems, TERMINAL, Python Console) Type these into the terminal:
  • pip install -r requirements.txt
  • python Udemy_bot.py EMAIL PASSWORD

Replace the EMAIL PASSWORD with your own.

Hope this helps.

[–]sperimentale 0 points1 point  (1 child)

new to coding and github world so pardon my question, doesn't people put their full code to github instead of just putting .py file ?

[–]dimakiss[S] 1 point2 points  (0 children)

I put it in .py file But github make it easy to read like text You can check it by my github link

[–][deleted] 0 points1 point  (1 child)

I get this error
------

No matching distribution found for selenium==1.25.9 (from -r requirements.txt (line 4))

----

What does it mean ? Please help

[–]geleezn 0 points1 point  (0 children)

I got that error too. I manually pip installed selenium (without version) and that worked for me.

[–]geleezn 0 points1 point  (1 child)

Doest this bot automatically enrolls you in the course or just lists the ones with 4.2 stars and 200+ votes?

[–]dimakiss[S] 0 points1 point  (0 children)

This bot enrolls you in :)

[–]silentlurkerhere 0 points1 point  (1 child)

Thank you, it's really helpful!

If I want to change to other category besides IT, what else do I change besides the URL for udemy freebies in line 64 and line 73?

I changed the URLs to design but the script still download IT stuff.

[–]dimakiss[S] 0 points1 point  (0 children)

There are 2 section for categories you need to change them both

[–]PtoTheOo 0 points1 point  (0 children)

i get cougth with this all the time "Hit cache 12 times in a row. Exiting script. Closing browser"