Skip to content

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

Update browser_use/browser/session.py

Mert Unsal5c3f0de8d123
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 97ea974da..a70fae256 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -3894,7 +3894,7 @@ class BrowserSession(BaseModel):
# Check if already downloaded
expected_path = os.path.join(self.browser_profile.downloads_path, pdf_filename)
- if any(pdf_filename in downloaded for downloaded in self._downloaded_files):
+ if any(os.path.basename(downloaded) == pdf_filename for downloaded in self._downloaded_files):
self.logger.debug(f'📄 PDF already downloaded: {pdf_filename}')
return None