mirror of
https://github.com/MontFerret/ferret.git
synced 2025-07-05 00:49:00 +02:00
Feature/new selector type (#657)
* Added remote type reference resolver * Added support of XPath query selector * Added CDP e2e testss covering XPath integration * Added additional CDP e2e tests covering XPath integration * Added type check to QuerySelector casting function * Fixed XPath e2e tests * Fixed vuln issue * Added support of XPath selectors to http driver * Added e2e tests for XPAth
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"github.com/MontFerret/ferret/pkg/drivers"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/core"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/values"
|
||||
"github.com/MontFerret/ferret/pkg/runtime/values/types"
|
||||
)
|
||||
|
||||
// INNER_TEXT returns inner text string of a given or matched by CSS selector element
|
||||
@ -30,13 +29,11 @@ func GetInnerText(ctx context.Context, args ...core.Value) (core.Value, error) {
|
||||
return el.GetInnerText(ctx)
|
||||
}
|
||||
|
||||
err = core.ValidateType(args[1], types.String)
|
||||
selector, err := drivers.ToQuerySelector(args[1])
|
||||
|
||||
if err != nil {
|
||||
return values.None, err
|
||||
}
|
||||
|
||||
selector := args[1].(values.String)
|
||||
|
||||
return el.GetInnerTextBySelector(ctx, selector)
|
||||
}
|
||||
|
Reference in New Issue
Block a user