for i := range url {
doc, err := html.Parse(strings.NewReader(ParseHtml(url[i])))
if err != nil {
log.Fatal(err)
}
var f func(*html.Node)
f = func(n *html.Node) {
if n.Type == html.ElementNode && n.Data == "a" {
for _, a := range n.Attr {
if a.Key == "href" {
for _, value := range ParseEmail(ParseHtml(a.Val)) {
_, ok := registryEMAIL[value]
if !ok {
registryEMAIL[value] = 0
fmt.Println(value)
}
}
break
}
}
}
for c := n.FirstChild; c != nil; c = c.NextSibling {
f(c)
}
}
f(doc)
}