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 }