{"record":{"id":"0d63f19cd6d219b8","repo":"GopeedLab/gopeed","slug":"element-not-found-selector","errorCode":null,"errorMessage":"element not found: ${selector}","messagePattern":"element not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"pkg/download/engine/webview/runtime.go","lineNumber":174,"sourceCode":"}\n\nfunc (p *PageHandle) Execute(scriptOrFn any, args ...any) (any, error) {\n\tpage, err := p.page()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texpression, err := normalizeExecutable(scriptOrFn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn page.Execute(expression, args...)\n}\n\nfunc (p *PageHandle) Focus(selector string) error {\n\t_, err := p.Execute(`(selector) => {\n\t\tconst element = document.querySelector(selector);\n\t\tif (!element) {\n\t\t\tthrow new Error(\"element not found: \" + selector);\n\t\t}\n\t\tif (typeof element.focus !== \"function\") {\n\t\t\tthrow new Error(\"element is not focusable: \" + selector);\n\t\t}\n\t\telement.focus();\n\t\treturn true;\n\t}`, selector)\n\treturn err\n}\n\nfunc (p *PageHandle) Click(selector string, opts ...map[string]any) error {\n\tclickOpts := parseClickOptions(firstMap(opts))\n\t_, err := p.Execute(`(selector, delayMS) => {\n\t\tconst element = document.querySelector(selector);\n\t\tif (!element) {\n\t\t\tthrow new Error(\"element not found: \" + selector);\n\t\t}\n\t\tif (typeof element.scrollIntoView === \"function\") {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/GopeedLab/gopeed/blob/7b7327ffb30816273a74b142cccc0bc10c5a4c67/pkg/download/engine/webview/runtime.go#L156-L192","documentation":"Error \"element not found: ${selector}\" thrown in GopeedLab/gopeed.","triggerScenarios":"Thrown at pkg/download/engine/webview/runtime.go:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b7327ffb30816273a74b142cccc0bc10c5a4c67","analyzedAt":"2026-08-16T02:51:03.250Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}