{"record":{"id":"f88a64d8882a668b","repo":"browser-use/browser-use","slug":"element-with-given-id-not-found","errorCode":null,"errorMessage":"Element with given id not found","messagePattern":"Element with given id not found","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"browser_use/browser/watchdogs/default_action_watchdog.py","lineNumber":826,"sourceCode":"\t\t\t\t\tassert 'object' in result and 'objectId' in result['object'], (\n\t\t\t\t\t\t'Failed to find DOM element based on backendNodeId, maybe page content changed?'\n\t\t\t\t\t)\n\t\t\t\t\tobject_id = result['object']['objectId']\n\n\t\t\t\t\tawait cdp_session.cdp_client.send.Runtime.callFunctionOn(\n\t\t\t\t\t\tparams={\n\t\t\t\t\t\t\t'functionDeclaration': 'function() { this.click(); }',\n\t\t\t\t\t\t\t'objectId': object_id,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsession_id=session_id,\n\t\t\t\t\t)\n\t\t\t\t\tawait asyncio.sleep(0.05)\n\t\t\t\t\t# Navigation is handled by BrowserSession via events\n\t\t\t\t\treturn None\n\t\t\t\texcept Exception as js_e:\n\t\t\t\t\tself.logger.warning(f'CDP JavaScript click also failed: {js_e}')\n\t\t\t\t\tif 'No node with given id found' in str(js_e):\n\t\t\t\t\t\traise Exception('Element with given id not found')\n\t\t\t\t\telse:\n\t\t\t\t\t\traise Exception(f'Failed to click element: {js_e}')\n\n\t\t\t# Find the largest visible quad within the viewport\n\t\t\tbest_quad = None\n\t\t\tbest_area = 0\n\n\t\t\tfor quad in quads:\n\t\t\t\tif len(quad) < 8:\n\t\t\t\t\tcontinue\n\n\t\t\t\t# Calculate quad bounds\n\t\t\t\txs = [quad[i] for i in range(0, 8, 2)]\n\t\t\t\tys = [quad[i] for i in range(1, 8, 2)]\n\t\t\t\tmin_x, max_x = min(xs), max(xs)\n\t\t\t\tmin_y, max_y = min(ys), max(ys)\n\n\t\t\t\t# Check if quad intersects with viewport","sourceCodeStart":808,"sourceCodeEnd":844,"githubUrl":"https://github.com/browser-use/browser-use/blob/6c73fced2f6d45a11d88622fe56365a5fe18f28b/browser_use/browser/watchdogs/default_action_watchdog.py#L808-L844","documentation":"Error \"Element with given id not found\" thrown in browser-use/browser-use.","triggerScenarios":"document.getElementById inside the click JS helper returns null for the element's id.","commonSituations":"Element id changed or element removed by page script between resolution and JS click fallback.","solutions":["Re-fetch the element by its node id; the DOM may have changed.","Verify the backend node id is still valid for the current document."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c73fced2f6d45a11d88622fe56365a5fe18f28b","analyzedAt":"2026-08-14T19:42:40.557Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}