make application with base logic

This commit is contained in:
Gitea
2023-11-26 15:39:34 +03:00
parent 0553ea71c3
commit 606b94e35b
32 changed files with 1070 additions and 27 deletions

View File

@ -0,0 +1,20 @@
package sravni
import "golang.org/x/net/html"
func findNode(parent *html.Node, eq func(*html.Node) (found, deeper bool)) *html.Node {
for child := parent.FirstChild; child != nil; child = child.NextSibling {
found, deeper := eq(child)
if found {
return child
}
if deeper {
deeperChild := findNode(child, eq)
if deeperChild != nil {
return deeperChild
}
}
}
return nil
}