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
Use browser-use-core Rust package
Gregor Žuničb056911139a0
diff --git a/browser_use/rust/service.py b/browser_use/rust/service.pyindex 2ed3dbaa6..e176c9ce3 100644--- a/browser_use/rust/service.py+++ b/browser_use/rust/service.py@@ -205,13 +205,13 @@ def find_browser_use_terminal_binary() -> str:return path_binaryraise RustAgentError(f'Could not find browser-use-terminal. Install Browser Use Terminal with `{TERMINAL_INSTALL_COMMAND}`, '- 'install browser-use-rust, or set BROWSER_USE_TERMINAL_BINARY to a built terminal CLI.'+ 'install browser-use-core, or set BROWSER_USE_TERMINAL_BINARY to a built terminal CLI.')def _find_packaged_browser_use_terminal_binary() -> str | None:try:- from browser_use_rust import binary_path+ from browser_use_core import binary_pathexcept Exception:return Nonetry:@@ -6267,7 +6267,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):self._sdk_client = Noneraise RustAgentError(f'Unsupported browser-use-terminal SDK protocol {protocol_version!r}; expected 1. '- 'Install a compatible browser-use-rust package or set BROWSER_USE_TERMINAL_BINARY to a compatible binary.'+ 'Install a compatible browser-use-core package or set BROWSER_USE_TERMINAL_BINARY to a compatible binary.')return self._sdk_clientdiff --git a/pyproject.toml b/pyproject.tomlindex 4a98c5ae0..e3694ef79 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -59,7 +59,7 @@ dependencies = [[project.optional-dependencies]cli = ["textual==7.4.0"]-rust = ["browser-use-rust==0.13.0"]+rust = ["browser-use-core==0.13.0"]aws = ["boto3==1.42.37"]oci = ["oci==2.166.0"]video = ["imageio[ffmpeg]==2.37.2", "numpy==2.4.1"]diff --git a/tests/ci/test_rust_agent.py b/tests/ci/test_rust_agent.pyindex 89ebb67bd..fa5aba738 100644--- a/tests/ci/test_rust_agent.py+++ b/tests/ci/test_rust_agent.py@@ -2620,7 +2620,7 @@ def test_rust_terminal_binary_missing_error_mentions_install(monkeypatch):import browser_use.rust.service as rust_servicemonkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)- monkeypatch.setitem(sys.modules, 'browser_use_rust', None)+ monkeypatch.setitem(sys.modules, 'browser_use_core', None)monkeypatch.setattr(rust_service.Path, 'exists', lambda self: False)monkeypatch.setattr(rust_service.shutil, 'which', lambda binary: None)@@ -2629,21 +2629,21 @@ def test_rust_terminal_binary_missing_error_mentions_install(monkeypatch):message = str(exc_info.value)assert 'https://browser-use.com/terminal/install.sh' in message- assert 'browser-use-rust' in message+ assert 'browser-use-core' in messageassert 'BROWSER_USE_TERMINAL_BINARY' in messagedef test_rust_terminal_binary_prefers_packaged_binary(monkeypatch):import browser_use.rust.service as rust_service- class PackagedRust:+ class PackagedCore:@staticmethoddef binary_path(binary_name):assert binary_name == 'browser-use-terminal'return '/tmp/packaged-browser-use-terminal'monkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)- monkeypatch.setitem(sys.modules, 'browser_use_rust', PackagedRust)+ monkeypatch.setitem(sys.modules, 'browser_use_core', PackagedCore)monkeypatch.setattr(rust_service.Path, 'exists', lambda self: False)monkeypatch.setattr(rust_service.shutil, 'which', lambda binary_name: None)@@ -2658,7 +2658,7 @@ def test_rust_terminal_binary_finds_default_terminal_install(monkeypatch, tmp_pabinary.write_text('#!/bin/sh\n')monkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)- monkeypatch.setitem(sys.modules, 'browser_use_rust', None)+ monkeypatch.setitem(sys.modules, 'browser_use_core', None)monkeypatch.chdir(tmp_path)monkeypatch.setenv('BUT_HOME', str(tmp_path / '.browser-use-terminal'))monkeypatch.setenv('BUT_INSTALL_DIR', str(tmp_path / '.local' / 'bin'))