Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -184,7 +184,7 @@ def extract_text_and_links(html_content):
|
|
184 |
|
185 |
# Extract text
|
186 |
text = soup.get_text()
|
187 |
-
|
188 |
# Extract links
|
189 |
links = []
|
190 |
for link in soup.find_all('a', href=True):
|
|
|
184 |
|
185 |
# Extract text
|
186 |
text = soup.get_text()
|
187 |
+
text = re.sub(r'\s+', ' ', text).strip()
|
188 |
# Extract links
|
189 |
links = []
|
190 |
for link in soup.find_all('a', href=True):
|