browser-use: Unable to download file from pdf viewer
Bug Description
I am using this repo with Langraph. When I try to open a pdf link from web page, and prompt to download either clicking download icon on top right of pressing cmd+S, it confirms that file is downloaded to default path (Download folder) but it does not.
Reproduction Steps
Here is the prompt - prompt = “”"Prompt to download financial report for Bank of America
Objective Visit [BofA Online] (https://investor.bankofamerica.com/annual-reports-and-proxy-statements) and search for 2023 annual report and download it
Step 1
- Open [BofA Online] (https://investor.bankofamerica.com/annual-reports-and-proxy-statements)
Step 2
- Find Annual Report for 2023 and click on it. You might have to scroll the page to find the link.
Step 3
- You’ll see a pdf in a new tab. Download the pdf by clicking the download icon on top right. If you cannot perform this instruction, then try sending key command+S and then press enter to save at default location.
Important: Ensure efficiency and accuracy throughout the process. “”"
Code Sample
async def search_report(state: State):
"""First call to use Browser-Use and search"""
browser = Browser(
config=BrowserConfig(
new_context_config=BrowserContextConfig(save_downloads_path=os.path.join(os.path.expanduser('~'), 'downloads'))
))
query = (
f"Using a browser, perform the activities as stated here - '{state['task']}'"
)
agent = Agent(
task = query,
llm = llm,
browser = browser
)
history = await agent.run()
msg = history.final_result()
input("Press Enter to close the browser...")
await browser.close()
return {"output": msg}
Version
0.1.36
LLM Model
GPT-4o
Operating System
macOS Sequuoia 15.3
Relevant Log Output
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 22 (3 by maintainers)
@peetpro , I built a tool like this prototype, and added a request in the prompt for the agent to use this tool to download instead of clicking a download button. It’s a starting point, but works.
Ok, thanks for the clarification.
On Thu, 27 Mar 2025 at 09:26, Nick Sweeting @.***> wrote:
–
Regards, Manoj Tutika https://www.linkedin.com/in/manoj-tutika-09b16220/, CEO & Cofounder, Sunday AI https://getsunday.ai/
yeah I get it, thanks. But if the underlying playwright can’t get a hold of the identifier inside the pdf viewer, it can’t click on it at the end.
Wondering how to get that identifier. Does it make sense?