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
invalidate page state when child iframes navigate
Nick Sweeting36cfda581a30
diff --git a/browser_use/browser/context.py b/browser_use/browser/context.pyindex 0fb40ae6f..bb965b164 100644--- a/browser_use/browser/context.py+++ b/browser_use/browser/context.py@@ -760,8 +760,10 @@ class BrowserContext:# Check if current page is still valid, if not switch to another available pagetry:page = await self.get_current_page()- # Test if page is still accessible+ # Test if page and its iframes are still accessibleawait page.evaluate('1')+ # for frame in page.frames:+ # await frame.evaluate('1')except Exception as e:logger.debug(f'Current page is no longer accessible: {str(e)}')# Get all available pages