mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-15 15:03:17 +00:00
feat: implement links container selector for targeted scraping of linked content
This commit is contained in:
@@ -592,3 +592,14 @@ func ExtractContentWithCSS(content, includeSelector string, excludeSelectors []s
|
|||||||
logger.Printf("Extracted content length: %d\n", len(selectedContent))
|
logger.Printf("Extracted content length: %d\n", len(selectedContent))
|
||||||
return selectedContent, nil
|
return selectedContent, nil
|
||||||
}
|
}
|
||||||
|
func resolveURL(href, base string) string {
|
||||||
|
parsedBase, err := url.Parse(base)
|
||||||
|
if err != nil {
|
||||||
|
return href
|
||||||
|
}
|
||||||
|
parsedHref, err := url.Parse(href)
|
||||||
|
if err != nil {
|
||||||
|
return href
|
||||||
|
}
|
||||||
|
return parsedBase.ResolveReference(parsedHref).String()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user