Fix student name lookup.
Update gitignore.
This commit is contained in:
parent
0f532bd16a
commit
721bf68880
5
.gitignore
vendored
5
.gitignore
vendored
@ -168,5 +168,8 @@ cython_debug/
|
|||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
pdfs/
|
pdfs/
|
||||||
export/
|
export/
|
||||||
|
/**/*.pdf
|
||||||
@ -75,8 +75,8 @@ for idx, url in enumerate(attempt_links, start=1):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Try to get the student's name near the profile picture
|
# Try to get the student's name near the profile picture
|
||||||
student_name_elem = driver.find_element(By.CSS_SELECTOR, "td.cell a[href*='/user/view.php']")
|
student_name_elem = driver.find_element(By.CLASS_NAME, "userinitials")
|
||||||
student_name = student_name_elem.text.strip()
|
student_name = student_name_elem.accessible_name.strip()
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
# Fallback if name is not found
|
# Fallback if name is not found
|
||||||
student_name = f"student_{idx}"
|
student_name = f"student_{idx}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user