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.
update web_selenium.py to use try-with for headers (#2988)
non-adjective7fc6f2abfc8d
diff --git a/autogpt/commands/web_selenium.py b/autogpt/commands/web_selenium.pyindex 79a8ffd946..0f5764b534 100644--- a/autogpt/commands/web_selenium.py+++ b/autogpt/commands/web_selenium.py@@ -175,4 +175,9 @@ def add_header(driver: WebDriver) -> None:Returns:None"""- driver.execute_script(open(f"{FILE_DIR}/js/overlay.js", "r").read())+ try:+ with open(f"{FILE_DIR}/js/overlay.js", "r") as overlay_file:+ overlay_script = overlay_file.read()+ driver.execute_script(overlay_script)+ except Exception as e:+ print(f"Error executing overlay.js: {e}")