Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Cookies block other content
magmuellerd41657f26af0
diff --git a/src/state_manager/utils.py b/src/state_manager/utils.pyindex ca0468b7a..01ea06dda 100644--- a/src/state_manager/utils.py+++ b/src/state_manager/utils.py@@ -112,3 +112,8 @@ def save_formatted_html(html_content, output_file_name):# Save formatted HTML to filewith open("temp/"+output_file_name, 'w', encoding='utf-8') as f:f.write(formatted_html)+++def save_markdown(markdown_content, output_file_name):+ with open("temp/"+output_file_name, 'w', encoding='utf-8') as f:+ f.write(markdown_content)diff --git a/src/tests/test_kayak_search.py b/src/tests/test_kayak_search.pyindex cbb05d6ce..e9919b8fe 100644--- a/src/tests/test_kayak_search.py+++ b/src/tests/test_kayak_search.py@@ -1,8 +1,9 @@import unittest+import timefrom src.utils.selenium_utils import setup_selenium_driverfrom src.actions.browser_actions import BrowserActionsfrom src.state_manager.state import StateManager-from src.state_manager.utils import save_formatted_html+from src.state_manager.utils import save_formatted_html, save_markdownfrom src.agent_interface.planing_agent import PlaningAgent@@ -30,6 +31,7 @@ class TestKayakSearch(unittest.TestCase):# Get current statecurrent_state = self.state_manager.get_current_state()save_formatted_html(current_state["interactable_elements"], f"current_state_{i}.html")+ save_markdown(current_state["main_content"], f"current_state_{i}.md")# Get next action from agenttext = f"Current state: {current_state}"print(f"\n{text}\n")@@ -42,6 +44,11 @@ class TestKayakSearch(unittest.TestCase):print("Task completed")break+ # wait for 1 second+ # time.sleep(4)+ # wait until i hit enter in the console+ input("\n\n\nPress Enter to continue...")+else:self.fail("Failed to complete flight search task in maximum steps")