Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

removed SavePDFAction and set print bg to False

Anish Hiranandani45e23bb838fd
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index 4fd09cbe8..0ce71ff7a 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -1,4 +1,5 @@
import asyncio
+import re
import json
import enum
import logging
@@ -176,7 +177,7 @@ class Controller(Generic[Context]):
sanitized_filename = f'{slug}.pdf'
await page.emulate_media('screen')
- await page.pdf(path=sanitized_filename, format='A4', print_background=params.print_background)
+ await page.pdf(path=sanitized_filename, format='A4', print_background=False)
msg = f"Saving page with URL {page.url} as PDF to ./{sanitized_filename}"
logger.info(msg)
return ActionResult(extracted_content=msg, include_in_memory=True)
diff --git a/browser_use/controller/views.py b/browser_use/controller/views.py
index ddf3fa4a8..82995c9e3 100644
--- a/browser_use/controller/views.py
+++ b/browser_use/controller/views.py
@@ -48,11 +48,6 @@ class ExtractPageContentAction(BaseModel):
value: str
-class SavePDFAction(BaseModel):
- file_path: str
- print_background: bool = False
-
-
class NoParamsAction(BaseModel):
"""
Accepts absolutely anything in the incoming data