fix: Fix assignment mismatch in ExtractContentWithCSS function

This commit is contained in:
Arik Jones (aider)
2024-09-14 14:54:04 -05:00
parent 885f3fc2b8
commit ea12ad631c

View File

@@ -250,7 +250,10 @@ func ExtractContentWithCSS(content, selector string) (string, error) {
return "", fmt.Errorf("error parsing HTML: %v", err)
}
selectedContent := doc.Find(selector).Html()
selectedContent, err := doc.Find(selector).Html()
if err != nil {
return "", fmt.Errorf("error extracting content with CSS selector: %v", err)
}
if selectedContent == "" {
return "", fmt.Errorf("no content found with CSS selector: %s", selector)
}