-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (29 loc) · 1.09 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from logger import Udemy
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from getpass import getpass
import time
mail = input("Enter your e-mail")
password = getpass("Enter your Udemy password")
user = Udemy(mail, password)
browser = webdriver.Chrome("chromedriver.exe")
browser.get("https://www.udemy.com/join/login-popup/")
time.sleep(3)
mail = browser.find_element_by_name("email")
password = browser.find_element_by_name("password")
user.login(email, sifre)
browser.get('https://www.udemyfreebies.com/course-category/development')
coup_but = browser.find_elements_by_class_name('button-icon')
for course in coup_but:
if course.text != 'EXPIRED':
course.click()
time.sleep(1)
nb = browser.find_element_by_class_name('button-icon')
nb.click()
time.sleep(1)
cart = browser.find_element_by_class_name('udlite-btn udlite-btn-large udlite-btn-brand udlite-heading-md add-to-cart')
cart.click()
browser.get('https://www.udemyfreebies.com/course-category/development')
time.sleep(1)
browser.close()
user.buy(browser)