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
Add http_credentials to browser context.
Bartlomiej Wietrak4633eb5e1402
diff --git a/browser_use/browser/context.py b/browser_use/browser/context.pyindex 44b7595d5..5eb802317 100644--- a/browser_use/browser/context.py+++ b/browser_use/browser/context.py@@ -107,6 +107,10 @@ class BrowserContextConfig:include_dynamic_attributes: bool = TrueInclude dynamic attributes in the CSS selector. If you want to reuse the css_selectors, it might be better to set this to False.++ http_credentials: None+ Dictionary with HTTP authentication credentials, e.g.+ {"username": "bill", "password": "pa55w0rd"}"""cookies_file: str | None = None@@ -132,6 +136,7 @@ class BrowserContextConfig:viewport_expansion: int = 500allowed_domains: list[str] | None = Noneinclude_dynamic_attributes: bool = True+ http_credentials: dict[str, str] | None = None_force_keep_context_alive: bool = False@@ -326,6 +331,7 @@ class BrowserContext:record_video_dir=self.config.save_recording_path,record_video_size=self.config.browser_window_size,locale=self.config.locale,+ http_credentials=self.config.http_credentials,)if self.config.trace_path: