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
added 2 params to action
Anish Hiranandani552d4ff81c72
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.pyindex 7005bcb79..b9d495605 100644--- a/browser_use/controller/service.py+++ b/browser_use/controller/service.py@@ -174,7 +174,7 @@ class Controller(Generic[Context]):async def save_pdf(params: SavePDFAction, browser: BrowserContext):page = await browser.get_current_page()await page.emulate_media(params.media_type)- await page.pdf(path=params.file_name, format='A4')+ await page.pdf(path=params.file_path, format=params.format, print_background=params.print_background)msg = f"Saving page with URL {page.url} as PDF to {params.file_path}"logger.info(msg)diff --git a/browser_use/controller/views.py b/browser_use/controller/views.pyindex e2cde89e6..7169f31be 100644--- a/browser_use/controller/views.py+++ b/browser_use/controller/views.py@@ -51,6 +51,8 @@ class ExtractPageContentAction(BaseModel):class SavePDFAction(BaseModel):file_path: strmedia_type: Literal['screen', 'print'] = 'screen'+ format: Literal['A4', 'A3', 'A5', 'Legal', 'Letter'] = 'A4'+ print_background: bool = Falseclass NoParamsAction(BaseModel):