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
Merge branch 'main' into duplicate_file_download
Magnus Müllerae547c4a0577
diff --cc browser_use/browser/context.pyindex 48c5fa0b5,0e394dc62..32a1f0691--- a/browser_use/browser/context.py+++ b/browser_use/browser/context.py@@@ -1145,13 -1158,4 +1166,15 @@@ class BrowserContextscreenshot=None,tabs=[],)- # endregion++++ async def _get_unique_filename(self, directory, filename):+ """Generate a unique filename by appending (1), (2), etc., if a file already exists."""+ base, ext = os.path.splitext(filename)+ counter = 1+ new_filename = filename+ while os.path.exists(os.path.join(directory, new_filename)):+ new_filename = f'{base} ({counter}){ext}'+ counter += 1+ return new_filename++