mgokg commited on
Commit
2c9db66
·
verified ·
1 Parent(s): 07a65bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -9,9 +9,17 @@ def parse_links(ort):
9
  # Senden der Anfrage an die initiale URL
10
  response = requests.get(initial_url)
11
  response.raise_for_status() # Überprüfen, ob die Anfrage erfolgreich war
12
- print(response)
13
  # Parse the HTML content using BeautifulSoup
14
  soup = BeautifulSoup(response.content, 'html.parser')
 
 
 
 
 
 
 
 
 
15
 
16
  # Erstelle die Gradio-Schnittstelle
17
  with gr.Blocks() as demo:
 
9
  # Senden der Anfrage an die initiale URL
10
  response = requests.get(initial_url)
11
  response.raise_for_status() # Überprüfen, ob die Anfrage erfolgreich war
 
12
  # Parse the HTML content using BeautifulSoup
13
  soup = BeautifulSoup(response.content, 'html.parser')
14
+ # Den body-Tag finden
15
+ body_tag = soup.find('body')
16
+ # Den Text des body-Tags zurückgeben
17
+ body_text = body_tag.get_text()
18
+ # Den Text ausgeben
19
+ print(body_text)
20
+
21
+ return body_text
22
+
23
 
24
  # Erstelle die Gradio-Schnittstelle
25
  with gr.Blocks() as demo: