AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Adds error check to text scraper.
Torantulino6d796d222dd5
diff --git a/AutonomousAI/browse.py b/AutonomousAI/browse.pyindex ea05421b57..361f0cb8d4 100644--- a/AutonomousAI/browse.py+++ b/AutonomousAI/browse.py@@ -4,8 +4,14 @@ from bs4 import BeautifulSoupfrom readability import Document#import openai+def scrape_text(url):response = requests.get(url)++ # Check if the response contains an HTTP error+ if response.status_code >= 400:+ return "Error: HTTP " + str(response.status_code) + " error"+soup = BeautifulSoup(response.text, "html.parser")for script in soup(["script", "style"]):