Ejemplo n.º 1
0
def attendancerecord():
    if session.get('login'):
        studentclassroom = Student_Class(dsn=app.config['dsn'])
        attendance = Attendance(dsn=app.config['dsn'])
        sinif = session['sinif']
        teacher_id = session['login']
        ids = []
        ids = studentclassroom.get_id_all_students(sinif)
        stringvalue = attendance.insert_attendance(ids, sinif)
        return stringvalue
    else:
        return redirect(url_for('home_page'))
Ejemplo n.º 2
0
attendance_soup = bs(attendance_html, 'lxml')
tables = attendance_soup.find_all('table')
for table in tables:
    table_rows = table.find_all('tr')
    for i, tr in enumerate(table_rows):
        # if i == 0:
        #     continue
        td_rs = tr.find_all('td')
        # print(td_rs)
        raw_list = []
        # print("New result-set: ")
        for td in td_rs:
            raw_list.append(td.text)
        raw_data = '\n'.join(raw_list)
        # print(raw_data)
        Attendance.insert_attendance(raw_data)

print("\nFetching scores")
driver.get(
    'https://auris.ahduni.edu.in/core-emli/code/student_portal/home.php?page=notification/exam_result'
)
temp_element = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.CLASS_NAME, 'logo')))
# # time.sleep(10)
scores_html = driver.page_source
# scores_html = open('test.html')
scores_soup = bs(scores_html, 'lxml')

tables = scores_soup.find_all('table')
# print(type(tables))
newlineRegex = re.compile(r'\s*<br/>\s*')