Skip to content

Commit 49bc5b2

Browse files
committed
Use new bs4 syntax: find_previous("tag", "class-name") -> find_previous("tag", {"class": "class-name"})
1 parent 5f54896 commit 49bc5b2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

catalog/management/commands/download_programs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def handle(self, *args: Any, **options: Any) -> None:
7171
if mnemonic_span.text not in known_slugs:
7272
fac = mnemonic_span.find_previous_siblings("a")
7373
program_name = mnemonic_span.find_previous(
74-
"strong", "search-result__structure-intitule"
74+
"strong", {"class": "search-result__structure-intitule"}
7575
).text
7676

7777
faculties: list = []
@@ -91,13 +91,13 @@ def handle(self, *args: Any, **options: Any) -> None:
9191
}
9292

9393
if option_div := mnemonic_span.find_previous(
94-
"div", "search-result__resultat--fille"
94+
"div", {"class": "search-result__resultat--fille"}
9595
):
9696
parent_program_div = option_div.find_previous(
97-
"div", "search-result__result-item"
97+
"div", {"class": "search-result__result-item"}
9898
)
9999
parent_mnemonic_span = parent_program_div.find(
100-
"span", "search-result__mnemonique"
100+
"span", {"class": "search-result__mnemonique"}
101101
)
102102
p["parent"] = parent_mnemonic_span.text
103103
parent_programs.add(parent_mnemonic_span.text)

0 commit comments

Comments
 (0)