find favicons
This commit is contained in:
parent
1f042a8434
commit
c896440525
3 changed files with 68 additions and 22 deletions
|
|
@ -7,6 +7,15 @@ import (
|
|||
"golang.org/x/net/html"
|
||||
)
|
||||
|
||||
func any(els []string, el string, match func(string, string) bool) bool {
|
||||
for _, x := range els {
|
||||
if match(x, el) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func getAttr(node *html.Node, key string) string {
|
||||
for _, a := range node.Attr {
|
||||
if a.Key == key {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue