#Extracting data from HTML
5 messages · Page 1 of 1 (latest)
Hello I am new to golang I was wondering what is the most memory efficent way to extract data from html response from a http request body if its very big?
Before that, what was your current approach?
Because doing it in the most memory-efficient way is difficult and sometimes not worth the effort.
i was just stringing the body then returning it then using function like this func extractBetween(s, left, right string) string {
start := strings.Index(s, left)
if start == -1 {
return ""
}
start += len(left)
end := strings.Index(s[start:], right)
if end == -1 {
return ""
}
return s[start : start+end]
} to get specific value i need i know i dont think this is good : / i only need a specific part of the html
use antchfx/htmlquery or PuerkitoBio/goquery
that's what colly use.