mgokg commited on
Commit
1b3508d
·
verified ·
1 Parent(s): 54a8c67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -14,7 +14,15 @@ def parse_links(ort):
14
 
15
  # Parse the HTML content using BeautifulSoup
16
  soup = BeautifulSoup(response.content, 'html.parser')
 
 
 
17
 
 
 
 
 
 
18
  # Den body-Tag finden
19
  body_tag = soup.find('body')
20
 
 
14
 
15
  # Parse the HTML content using BeautifulSoup
16
  soup = BeautifulSoup(response.content, 'html.parser')
17
+
18
+ # Finde alle p-Tags
19
+ p_tags = soup.find_all('p')
20
 
21
+ # Füge den Text der p-Tags zu einem String hinzu
22
+ p_text = ' '.join(tag.get_text() for tag in p_tags)
23
+
24
+ # Rückgabe als Dictionary, um es mit gr.JSON kompatibel zu machen
25
+ return {"p_text": p_text}
26
  # Den body-Tag finden
27
  body_tag = soup.find('body')
28