mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
fix: web scraper concatenate words
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import re
|
||||
from typing import Any, Optional, Type
|
||||
|
||||
import requests
|
||||
@@ -67,7 +68,6 @@ class ScrapeWebsiteTool(BaseTool):
|
||||
page.encoding = page.apparent_encoding
|
||||
parsed = BeautifulSoup(page.text, "html.parser")
|
||||
|
||||
text = parsed.get_text()
|
||||
text = "\n".join([i for i in text.split("\n") if i.strip() != ""])
|
||||
text = " ".join([i for i in text.split(" ") if i.strip() != ""])
|
||||
text = parsed.get_text(" ")
|
||||
text = re.sub('\s+', ' ', text)
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user