Files
fn_registry/functions/browser/cdp_get_frame_html.go
T
egutierrez 5b10b419a2 feat(browser): auto-commit con 44 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-06 12:49:54 +02:00

24 lines
622 B
Go

package browser
import (
"fmt"
)
// CdpGetFrameHTML retorna el HTML completo (outerHTML del documentElement) de un iframe
// especifico usando CdpEvalInFrame con la expresion "document.documentElement.outerHTML".
func CdpGetFrameHTML(c *CDPConn, frameID string) (string, error) {
if c == nil {
return "", fmt.Errorf("cdp get frame html: conexion nula")
}
if frameID == "" {
return "", fmt.Errorf("cdp get frame html: frameID vacio")
}
html, err := CdpEvalInFrame(c, frameID, "document.documentElement.outerHTML")
if err != nil {
return "", fmt.Errorf("cdp get frame html: %w", err)
}
return html, nil
}