Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,9 @@ async def scraper(url):
|
|
31 |
|
32 |
async def text_scraper(url):
|
33 |
"""Fetches HTML content using AsyncFetcher and than extract text."""
|
34 |
-
html = await async_fetcher.get(url) # Use await for async operations
|
35 |
-
|
|
|
36 |
text = re.sub(r'\n+', ' ', text)
|
37 |
text = re.sub(r'\s+', ' ', text)
|
38 |
return text
|
|
|
31 |
|
32 |
async def text_scraper(url):
|
33 |
"""Fetches HTML content using AsyncFetcher and than extract text."""
|
34 |
+
html = await async_fetcher.get(url).get_all_text() # Use await for async operations
|
35 |
+
print(html)
|
36 |
+
text = html
|
37 |
text = re.sub(r'\n+', ' ', text)
|
38 |
text = re.sub(r'\s+', ' ', text)
|
39 |
return text
|