test4good commited on
Commit
3088954
1 Parent(s): 6a4d5f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 <h2> tags
76
  structured_sections = {}
77
- for section in soup.find_all("h2"):
78
  section_title = section.get_text(strip=True)
79
  section_content = []
80
  for sibling in section.find_next_siblings():
81
- if sibling.name == "h2":
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: