MCPcopy
hub / github.com/PuerkitoBio/goquery / Get

Method Get

array.go:73–78  ·  view source on GitHub ↗

Get retrieves the underlying node at the specified index. Get without parameter is not implemented, since the node array is available on the Selection object.

(index int)

Source from the content-addressed store, hash-verified

71// Get without parameter is not implemented, since the node array is available
72// on the Selection object.
73func (s *Selection) Get(index int) *html.Node {
74 if index < 0 {
75 index += len(s.Nodes) // Negative index gets from the end
76 }
77 return s.Nodes[index]
78}
79
80// Index returns the position of the first element within the Selection object
81// relative to its sibling elements.

Callers 15

winnowFunction · 0.80
winnowNodesFunction · 0.80
TestMapFunction · 0.80
TestGenericMapFunction · 0.80
assertClassFunction · 0.80
assertSelectionIsFunction · 0.80
TestGetFunction · 0.80
TestGetNegativeFunction · 0.80
TestGetInvalidFunction · 0.80
TestNodeNameFunction · 0.80
TestOuterHtmlFunction · 0.80
NewDocumentFunction · 0.80

Calls

no outgoing calls

Tested by 14

TestMapFunction · 0.64
TestGenericMapFunction · 0.64
assertClassFunction · 0.64
assertSelectionIsFunction · 0.64
TestGetFunction · 0.64
TestGetNegativeFunction · 0.64
TestGetInvalidFunction · 0.64
TestNodeNameFunction · 0.64
TestOuterHtmlFunction · 0.64
ExampleFunction · 0.64
BenchmarkFilterFunctionFunction · 0.64
BenchmarkNotFunctionFunction · 0.64