Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,25 +20,9 @@ def parse_links_and_content(ort):
|
|
20 |
|
21 |
# Parse the HTML content using BeautifulSoup
|
22 |
soup = BeautifulSoup(response.content, 'html.parser')
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
if link_element and 'href' in link_element.attrs:
|
28 |
-
href = link_element['href']
|
29 |
-
# Extrahiere die letzten beiden Zeichen der URL
|
30 |
-
last_two_chars = href[-2:]
|
31 |
-
|
32 |
-
# Konvertiere die letzten beiden Zeichen in einen Integer
|
33 |
-
last_two_chars_int = int(last_two_chars)
|
34 |
-
|
35 |
-
# Wenn die aktuelle Seite die letzte Seite ist, breche die Schleife ab
|
36 |
-
if page_number >= last_two_chars_int:
|
37 |
-
break
|
38 |
-
else:
|
39 |
-
# Wenn kein Link zur nächsten Seite gefunden wird, breche die Schleife ab
|
40 |
-
break
|
41 |
-
|
42 |
# Finde das Element mit dem CSS-Selektor
|
43 |
target_div = soup.select_one('div.row-cols-1:nth-child(4)')
|
44 |
|
|
|
20 |
|
21 |
# Parse the HTML content using BeautifulSoup
|
22 |
soup = BeautifulSoup(response.content, 'html.parser')
|
23 |
+
|
24 |
+
if page_number < last_two_chars_int:
|
25 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
# Finde das Element mit dem CSS-Selektor
|
27 |
target_div = soup.select_one('div.row-cols-1:nth-child(4)')
|
28 |
|