1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-03-03 15:02:32 +02:00

Refactoring/#230 xpath (#324)

* sync with MontFerret/ferret

* fix --param handling

When params is converted to map it uses strings.Split,
which slices a string into all substrings separated by :.

* delete degub Println
This commit is contained in:
3timeslazy 2019-07-03 22:31:18 +03:00 committed by Tim Voronov
parent 7ce6797e9c
commit cf8c55ab99

View File

@ -3,8 +3,6 @@ package http
import (
"context"
"encoding/json"
"fmt"
"github.com/antchfx/htmlquery"
"hash/fnv"
"strings"
@ -14,6 +12,7 @@ import (
"github.com/MontFerret/ferret/pkg/runtime/values"
"github.com/PuerkitoBio/goquery"
"github.com/antchfx/htmlquery"
"github.com/antchfx/xpath"
)
@ -331,8 +330,6 @@ func (el *HTMLElement) XPath(_ context.Context, expression values.String) (core.
return values.None, err
}
fmt.Println(htmlquery.OutputHTML(rootNode, true))
out := exp.Evaluate(htmlquery.CreateXPathNavigator(rootNode))
switch res := out.(type) {