Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PuerkitoBio/goquery
/ functions
Functions
666 in github.com/PuerkitoBio/goquery
⨍
Functions
666
◇
Types & classes
7
↓ 419 callers
Method
Find
Find gets the descendants of each element in the current set of matched elements, filtered by a selector. It returns a new Selection object containing
traversal.go:29
↓ 221 callers
Function
Doc
()
type_test.go:21
↓ 195 callers
Function
assertLength
(t *testing.T, nodes []*html.Node, length int)
type_test.go:64
↓ 75 callers
Method
Length
Length returns the number of elements in the Selection object.
property.go:81
↓ 73 callers
Function
DocW
()
type_test.go:57
↓ 66 callers
Method
End
End ends the most recent filtering operation in the current chain and returns the set of matched elements to its previous state.
filter.go:136
↓ 62 callers
Function
assertEqual
(t *testing.T, s1 *Selection, s2 *Selection)
type_test.go:85
↓ 57 callers
Function
Doc2Clone
()
type_test.go:35
↓ 56 callers
Function
printSel
(t *testing.T, sel *Selection)
type_test.go:99
↓ 39 callers
Function
pushStack
Creates a new Selection object based on the specified nodes, and keeps the source Selection object on the stack (linked list).
utilities.go:240
↓ 37 callers
Function
compileMatcher
compileMatcher compiles the selector string s and returns the corresponding Matcher. If s is an invalid selector string, it returns a Matcher that fai
type.go:166
↓ 29 callers
Function
assertSelectionIs
(t *testing.T, sel *Selection, is ...string)
type_test.go:91
↓ 29 callers
Function
getSiblingNodes
Internal implementation of sibling nodes that return a raw slice of matches.
traversal.go:580
↓ 28 callers
Function
filterAndPush
Filter and push filters the nodes based on a matcher, and pushes the results on the stack, with the srcSel as previous selection.
traversal.go:539
↓ 27 callers
Function
Doc2
()
type_test.go:28
↓ 20 callers
Function
NewDocumentFromReader
NewDocumentFromReader returns a Document from an io.Reader. It returns an error as second value if the reader's data cannot be parsed as html. It does
type.go:51
↓ 18 callers
Method
Eq
Eq reduces the set of matched elements to the one at the specified index. If a negative index is given, it counts backwards starting at the end of the
array.go:35
↓ 17 callers
Method
Get
Get retrieves the underlying node at the specified index. Get without parameter is not implemented, since the node array is available on the Selection
array.go:73
↓ 14 callers
Function
DocB
()
type_test.go:50
↓ 14 callers
Method
Slice
Slice reduces the set of matched elements to a subset specified by a range of indices. The start index is 0-based and indicates the index of the first
array.go:58
↓ 14 callers
Method
Text
Text gets the combined text contents of each element in the set of matched elements, including their descendants.
property.go:56
↓ 14 callers
Function
assertClass
(t *testing.T, sel *Selection, class string)
type_test.go:73
↓ 13 callers
Method
Attr
Attr gets the specified attribute's value for the first element in the Selection. To get the value for each element individually, use a looping constr
property.go:14
↓ 12 callers
Function
newSingleSelection
Helper constructor to create a selection of only one node
type.go:111
↓ 11 callers
Method
First
First reduces the set of matched elements to the first in the set. It returns a new Selection object, and an empty Selection object if the the selecti
array.go:20
↓ 10 callers
Method
HasClass
HasClass determines whether any of the matched elements are assigned the given class.
property.go:131
↓ 10 callers
Method
Last
Last reduces the set of matched elements to the last in the set. It returns a new Selection object, and an empty Selection object if the selection is
array.go:27
↓ 10 callers
Method
MatchAll
(*html.Node)
type.go:120
↓ 10 callers
Function
getParentsNodes
Internal implementation to get all parent nodes, stopping at the specified node (or nil if no stop).
traversal.go:559
↓ 9 callers
Method
AddNodes
AddNodes adds the specified nodes to those in the current selection and returns a new Selection object.
expand.go:37
↓ 9 callers
Method
Contains
Contains returns true if the specified Node is within, at any depth, one of the nodes in the Selection object. It is NOT inclusive, to behave like jQu
query.go:58
↓ 9 callers
Method
Each
Each iterates over a Selection object, executing a function for each matched element. It returns the current Selection object. The function f is calle
iteration.go:10
↓ 9 callers
Method
Filter
([]*html.Node)
type.go:121
↓ 8 callers
Method
AddSelection
AddSelection adds the specified Selection object's nodes to those in the current selection and returns a new Selection object.
expand.go:23
↓ 8 callers
Method
Contents
Contents gets the children of each element in the Selection, including text and comment nodes. It returns a new Selection object containing these elem
traversal.go:65
↓ 8 callers
Method
Remove
Remove removes the set of matched elements from the document. It returns the same selection, now consisting of nodes not in the document.
manipulation.go:235
↓ 8 callers
Function
loadString
(t *testing.T, doc string)
type_test.go:125
↓ 7 callers
Method
ChildrenFiltered
ChildrenFiltered gets the child elements of each element in the Selection, filtered by the specified selector. It returns a new Selection object conta
traversal.go:98
↓ 7 callers
Method
Closest
Closest gets the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
traversal.go:129
↓ 7 callers
Method
ClosestNodes
ClosestNodes gets the first element that matches one of the nodes by testing the element itself and traversing up through its ancestors in the DOM tre
traversal.go:151
↓ 7 callers
Method
Has
Has reduces the set of matched elements to those that have a descendant that matches the selector. It returns a new Selection object with the matching
filter.go:81
↓ 7 callers
Method
Html
Html gets the HTML contents of the first element in the set of matched elements. It includes text and comment nodes.
property.go:87
↓ 7 callers
Method
Is
Is checks the current matched set of elements against a selector and returns true if at least one of these elements matches.
query.go:7
↓ 7 callers
Method
Parent
Parent gets the parent of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:111
↓ 7 callers
Method
PrevUntil
PrevUntil gets all preceding siblings of each element up to but not including the element matched by the selector. It returns a new Selection object c
traversal.go:408
↓ 7 callers
Function
Text
Text returns the combined text contents of the nodes in the selection, including their descendants, in document order. It is a package-level function
utilities.go:93
↓ 7 callers
Function
mapNodes
Internal map function used by many traversing methods. Takes the source nodes to iterate on and the mapping function that returns an array of nodes. R
traversal.go:711
↓ 6 callers
Method
AddClass
AddClass adds the given class(es) to each element in the set of matched elements. Multiple class names can be specified, separated by a space or via m
property.go:107
↓ 6 callers
Method
Children
Children gets the child elements of each element in the Selection. It returns a new Selection object containing these elements.
traversal.go:91
↓ 6 callers
Method
ClosestSelection
ClosestSelection gets the first element that matches one of the nodes in the Selection by testing the element itself and traversing up through its anc
traversal.go:171
↓ 6 callers
Method
NextAll
NextAll gets all the following siblings of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:313
↓ 6 callers
Method
PrevAll
PrevAll gets all the preceding siblings of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:353
↓ 6 callers
Function
assertPanic
(t *testing.T)
type_test.go:79
↓ 6 callers
Method
eachNodeHtml
eachNodeHtml parses the given html string and inserts the resulting nodes in the dom with the mergeFn. The parsed nodes are inserted for each element
manipulation.go:648
↓ 6 callers
Function
loadDoc
(page string)
type_test.go:109
↓ 6 callers
Method
wrapAllNodes
(ns ...*html.Node)
manipulation.go:460
↓ 5 callers
Method
FilterSelection
FilterSelection reduces the set of matched elements to those that match a node in the specified Selection object. It returns a new Selection object fo
filter.go:57
↓ 5 callers
Method
Match
(*html.Node)
type.go:119
↓ 5 callers
Method
Next
Next gets the immediately following sibling of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:293
↓ 5 callers
Method
NextAllFiltered
NextAllFiltered gets all the following siblings of each element in the Selection filtered by a selector. It returns a new Selection object containing
traversal.go:320
↓ 5 callers
Method
NextFiltered
NextFiltered gets the immediately following sibling of each element in the Selection filtered by a selector. It returns a new Selection object contain
traversal.go:300
↓ 5 callers
Method
NextUntil
NextUntil gets all following siblings of each element up to but not including the element matched by the selector. It returns a new Selection object c
traversal.go:374
↓ 5 callers
Method
Not
Not removes elements from the Selection that match the selector string. It returns a new Selection object with the matching elements removed.
filter.go:20
↓ 5 callers
Method
Parents
Parents gets the ancestors of each element in the current Selection. It returns a new Selection object with the matched elements.
traversal.go:180
↓ 5 callers
Method
Prev
Prev gets the immediately preceding sibling of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:333
↓ 5 callers
Method
SetHtml
SetHtml sets the html content of each element in the selection to specified html string.
manipulation.go:318
↓ 5 callers
Method
Siblings
Siblings gets the siblings of each element in the Selection. It returns a new Selection object containing the matched elements.
traversal.go:273
↓ 5 callers
Function
cloneNode
Deep copy a node. The new node has clones of all the original node's children but none of its parents or siblings.
manipulation.go:598
↓ 5 callers
Function
indexInSlice
Returns the index of the target node in the slice, or -1.
utilities.go:181
↓ 5 callers
Function
isInSlice
Checks if the target node is in the slice of nodes.
utilities.go:176
↓ 4 callers
Method
Add
Add adds the selector string's matching nodes to those in the current selection and returns a new Selection object. The selector string is run in the
expand.go:9
↓ 4 callers
Method
AppendSelection
AppendSelection appends the elements in the selection to the end of each element in the set of matched elements. This follows the same rules as Selec
manipulation.go:90
↓ 4 callers
Method
ContentsFiltered
ContentsFiltered gets the children of each element in the Selection, filtered by the specified selector. It returns a new Selection object containing
traversal.go:74
↓ 4 callers
Method
EachIter
EachIter returns an iterator that yields the Selection object in order. The implementation is similar to Each, but it returns an iterator instead.
iteration.go:19
↓ 4 callers
Method
FilterMatcher
FilterMatcher reduces the set of matched elements to those that match the given matcher. It returns a new Selection object for this subset of matching
filter.go:14
↓ 4 callers
Method
FindMatcher
FindMatcher gets the descendants of each element in the current set of matched elements, filtered by the matcher. It returns a new Selection object co
traversal.go:36
↓ 4 callers
Method
HasNodes
HasNodes reduces the set of matched elements to those that have a descendant that matches one of the nodes. It returns a new Selection object with the
filter.go:111
↓ 4 callers
Method
NextFilteredUntil
NextFilteredUntil is like NextUntil, with the option to filter the results based on a selector string. It returns a new Selection object containing th
traversal.go:442
↓ 4 callers
Method
NextUntilNodes
NextUntilNodes gets all following siblings of each element up to but not including the element matched by the nodes. It returns a new Selection object
traversal.go:400
↓ 4 callers
Method
ParentFiltered
ParentFiltered gets the parent of each element in the Selection filtered by a selector. It returns a new Selection object containing the matched eleme
traversal.go:117
↓ 4 callers
Method
ParentsFiltered
ParentsFiltered gets the ancestors of each element in the current Selection. It returns a new Selection object with the matched elements.
traversal.go:186
↓ 4 callers
Method
ParentsFilteredUntil
ParentsFilteredUntil is like ParentsUntil, with the option to filter the results based on a selector string. It returns a new Selection object contain
traversal.go:230
↓ 4 callers
Method
ParentsUntil
ParentsUntil gets the ancestors of each element in the Selection, up to but not including the element matched by the selector. It returns a new Select
traversal.go:199
↓ 4 callers
Method
ParentsUntilNodes
ParentsUntilNodes gets the ancestors of each element in the Selection, up to but not including the specified nodes. It returns a new Selection object
traversal.go:223
↓ 4 callers
Method
PrevAllFiltered
PrevAllFiltered gets all the preceding siblings of each element in the Selection filtered by a selector. It returns a new Selection object containing
traversal.go:360
↓ 4 callers
Method
PrevFiltered
PrevFiltered gets the immediately preceding sibling of each element in the Selection filtered by a selector. It returns a new Selection object contain
traversal.go:340
↓ 4 callers
Method
PrevFilteredUntil
PrevFilteredUntil is like PrevUntil, with the option to filter the results based on a selector string. It returns a new Selection object containing th
traversal.go:491
↓ 4 callers
Method
PrevUntilNodes
PrevUntilNodes gets all preceding siblings of each element up to but not including the element matched by the nodes. It returns a new Selection object
traversal.go:434
↓ 4 callers
Method
RemoveClass
RemoveClass removes the given class(es) from each element in the set of matched elements. Multiple class names can be specified, separated by a space
property.go:154
↓ 4 callers
Method
SiblingsFiltered
SiblingsFiltered gets the siblings of each element in the Selection filtered by a selector. It returns a new Selection object containing the matched e
traversal.go:280
↓ 4 callers
Method
Unwrap
Unwrap removes the parents of the set of matched elements, leaving the matched elements (and their siblings, if any) in their place. It returns the or
manipulation.go:340
↓ 4 callers
Function
cloneNodes
Deep copy a slice of nodes.
manipulation.go:586
↓ 4 callers
Function
findWithMatcher
Internal implementation of Find that return raw nodes.
traversal.go:544
↓ 4 callers
Function
getAttributePtr
(attrName string, n *html.Node)
property.go:208
↓ 4 callers
Function
getChildrenNodes
Gets the children nodes of each node in the specified slice of nodes, based on the sibling type request.
traversal.go:603
↓ 4 callers
Method
manipulateNodes
(ns []*html.Node, reverse bool, f func(sn *html.Node, n *html.Node))
manipulation.go:614
↓ 4 callers
Function
newDocument
Private constructor, make sure all fields are correctly filled.
type.go:89
↓ 4 callers
Function
winnowNodes
Filter based on an array of nodes, and the indicator to keep (Filter) or to get rid of (Not) the matching elements.
filter.go:162
↓ 4 callers
Method
wrapInnerNodes
(ns ...*html.Node)
manipulation.go:544
↓ 3 callers
Method
AddBack
AddBack adds the previous set of elements on the stack to the current set. It returns a new Selection object containing the current Selection combined
expand.go:52
next →
1–100 of 666, ranked by callers