mirror of
https://github.com/KevinMidboe/ITLscraper.git
synced 2025-10-29 01:30:14 +00:00
add start on GUI
This commit is contained in:
31
app.py
Normal file
31
app.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from appJar import gui
|
||||
from itl_scrape import itslearning_scraper
|
||||
app = gui("It's learning scraper")
|
||||
scraper = itslearning_scraper()
|
||||
|
||||
def press(btn):
|
||||
user = app.getEntry("feideuser")
|
||||
password = app.getEntry("password")
|
||||
scraper.login(user,password)
|
||||
|
||||
#if course_url:
|
||||
#else:
|
||||
print("pressed button", app.getEntry("feideuser"), app.getEntry("password"))
|
||||
app.removeAllWidgets()
|
||||
app.addLabel("title", "Courses to be selected", 0, 0, 2)
|
||||
test = scraper.get_courses()
|
||||
for i, label in enumerate(test):
|
||||
app.addCheckBox(test[label], i+1 ,0)
|
||||
|
||||
app.startLabelFrame("It's Learning time")
|
||||
app.setSticky("ew")
|
||||
app.setFont(20)
|
||||
|
||||
app.addLabel("feideuser", "Username:", 0,0)
|
||||
app.addEntry("feideuser",0,1)
|
||||
app.addLabel("password", "Password:", 1, 0)
|
||||
app.addSecretEntry("password", 1 , 1)
|
||||
app.stopLabelFrame()
|
||||
app.addButton("Login", press, 2, 0, 2)
|
||||
app.setFocus("feideuser")
|
||||
app.go()
|
||||
@@ -2,3 +2,4 @@ beautifulsoup4==4.6.0
|
||||
MechanicalSoup==0.7.0
|
||||
html2text==2016.9.19
|
||||
requests==2.13.0
|
||||
appJar==0.52
|
||||
|
||||
Reference in New Issue
Block a user