Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,13 +72,13 @@ def fetch_and_structure_content(url):
|
|
| 72 |
response.raise_for_status()
|
| 73 |
soup = BeautifulSoup(response.text, 'html.parser')
|
| 74 |
|
| 75 |
-
# Extract content under <
|
| 76 |
structured_sections = {}
|
| 77 |
-
for section in soup.find_all("
|
| 78 |
section_title = section.get_text(strip=True)
|
| 79 |
section_content = []
|
| 80 |
for sibling in section.find_next_siblings():
|
| 81 |
-
if sibling.name == "
|
| 82 |
break
|
| 83 |
text = sibling.get_text(strip=True)
|
| 84 |
if text:
|
|
|
|
| 72 |
response.raise_for_status()
|
| 73 |
soup = BeautifulSoup(response.text, 'html.parser')
|
| 74 |
|
| 75 |
+
# Extract content under <h3> tags
|
| 76 |
structured_sections = {}
|
| 77 |
+
for section in soup.find_all("h3"):
|
| 78 |
section_title = section.get_text(strip=True)
|
| 79 |
section_content = []
|
| 80 |
for sibling in section.find_next_siblings():
|
| 81 |
+
if sibling.name == "h3":
|
| 82 |
break
|
| 83 |
text = sibling.get_text(strip=True)
|
| 84 |
if text:
|