mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-13 06:23:18 +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))
|
||||
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