mirror of
https://github.com/Garmelon/PFERD.git
synced 2025-08-12 10:32:42 +02:00
Compare commits
2 Commits
fix/exerci
...
debug/dump
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f0e56a8e12 | ||
![]() |
8caad0008d |
@@ -22,9 +22,6 @@ ambiguous situations.
|
||||
|
||||
## Unreleased
|
||||
|
||||
## Fixed
|
||||
- Crawling of exercises with instructions
|
||||
|
||||
## 3.8.2 - 2025-04-29
|
||||
|
||||
## Changed
|
||||
|
@@ -45,8 +45,8 @@ def load(
|
||||
load_crawler(args, section)
|
||||
|
||||
section["type"] = COMMAND_NAME
|
||||
if args.ilias_url is not None:
|
||||
section["base_url"] = args.ilias_url
|
||||
if args.base_url is not None:
|
||||
section["base_url"] = args.base_url
|
||||
if args.client_id is not None:
|
||||
section["client_id"] = args.client_id
|
||||
|
||||
|
@@ -983,6 +983,8 @@ instance's greatest bottleneck.
|
||||
soup = IliasSoup(soupify(await request.read()), str(request.url))
|
||||
if IliasPage.is_logged_in(soup):
|
||||
return self._verify_page(soup, url, root_page_allowed)
|
||||
with open("/tmp/ilias_debug.html", "w") as f:
|
||||
f.write(str(soup.soup.prettify()))
|
||||
raise CrawlError(f"get_page failed even after authenticating on {url!r}")
|
||||
|
||||
@staticmethod
|
||||
|
@@ -975,17 +975,16 @@ class IliasPage:
|
||||
_unexpected_html_warning()
|
||||
return []
|
||||
|
||||
exercise_links = content_tab.select(".il-item-title a")
|
||||
|
||||
for exercise in cast(list[Tag], exercise_links):
|
||||
if "href" not in exercise.attrs:
|
||||
continue
|
||||
href = exercise.attrs["href"]
|
||||
if type(href) is not str:
|
||||
continue
|
||||
if "ass_id=" not in href or "cmdclass=ilassignmentpresentationgui" not in href.lower():
|
||||
continue
|
||||
individual_exercises = content_tab.find_all(
|
||||
name="a",
|
||||
attrs={
|
||||
"href": lambda x: x is not None
|
||||
and "ass_id=" in x
|
||||
and "cmdClass=ilAssignmentPresentationGUI" in x
|
||||
}
|
||||
)
|
||||
|
||||
for exercise in cast(list[Tag], individual_exercises):
|
||||
name = _sanitize_path_name(exercise.get_text().strip())
|
||||
results.append(IliasPageElement.create_new(
|
||||
IliasElementType.EXERCISE,
|
||||
|
Reference in New Issue
Block a user