-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheductive.py
41 lines (27 loc) · 977 Bytes
/
eductive.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 selenium import webdriver
import time
from bs4 import BeautifulSoup
import pdfkit
password = ""
browser = webdriver.Firefox()
browser.get('https://www.educative.io/login')
username = ""
time.sleep(5)
emailInput = browser.find_element_by_name('email')
emailInput.send_keys(username)
passwordInput = browser.find_element_by_name('password')
passwordInput.send_keys(password)
loginBTN = browser.find_element_by_xpath('//button[text()="Login"]')
loginBTN.click()
time.sleep(7)
browser.get('https://www.educative.io/module/lesson/microservices-implementation/7D62VMrLjzj')
time.sleep(10)
mainBox = browser.page_source
soup = BeautifulSoup(mainBox, 'html.parser')
for link in soup.find_all('a'):
# print(link.get('href'))
page = str(link.get('href'))
if 'module' in page :
# pdfkit.from_url('https://www.educative.io'+page, page+'.pdf')
# browser.get('https://www.educative.io'+page)
print(f'https://www.educative.io'+page)