MCPcopy Create free account

hub / github.com/go-shiori/dom / functions

Functions70 in github.com/go-shiori/dom

↓ 31 callersFunctionparseHTMLSource
(htmlSource string)
dom_test.go:1308
↓ 24 callersFunctionGetElementsByTagName
GetElementsByTagName returns a collection of all elements in the document with the specified tag name, as an array of Node object. The special tag "*"
dom.go:125
↓ 22 callersFunctionOuterHTML
OuterHTML returns an HTML serialization of the element and its descendants. The returned HTML value is escaped.
dom.go:305
↓ 10 callersFunctionCreateElement
CreateElement creates a new ElementNode with specified tag.
dom.go:147
↓ 6 callersFunctionGetAttribute
GetAttribute returns the value of a specified attribute on the element. If the given attribute does not exist, the value returned will be an empty str
dom.go:179
↓ 4 callersFunctionAppendChild
AppendChild adds a node to the end of the list of children of a specified parent node. If the given child is a reference to an existing node in the do
dom.go:429
↓ 4 callersFunctionIsVoidElement
IsVoidElement check whether a node can have any contents or not. Return true if element is void (can't have any children).
dom.go:581
↓ 4 callersFunctionTagName
TagName returns the tag name of a Node. If it's not ElementNode, return empty string.
dom.go:164
↓ 3 callersFunctionDetachChild
(child *html.Node)
dom.go:598
↓ 3 callersFunctionPrependChild
PrependChild works like AppendChild() except it adds a node to the beginning of the list of children of a specified parent node.
dom.go:439
↓ 2 callersFunctionHasAttribute
HasAttribute returns a Boolean value indicating whether the specified node has the specified attribute or not.
dom.go:228
↓ 2 callersFunctionQuerySelector
QuerySelector returns the first document's element that match the specified group of selectors.
dom.go:32
↓ 2 callersFunctionReplaceChild
ReplaceChild replaces a child node within the given (parent) node. If the new child is already exist in document, ReplaceChild() will move it from its
dom.go:456
↓ 2 callersFunctionSetTextContent
SetTextContent sets the text content of the specified node.
dom.go:534
↓ 2 callersFunctionTextContent
TextContent returns the text content of the specified node, and all its descendants.
dom.go:239
↓ 1 callersFunctionChildNodes
ChildNodes returns list of a node's direct children.
dom.go:382
↓ 1 callersFunctionChildren
Children returns an HTMLCollection of the direct child elements of Node.
dom.go:366
↓ 1 callersFunctionClassName
ClassName returns the value of the class attribute of the specified element.
dom.go:358
↓ 1 callersFunctionClone
Clone returns a clone of the node and (if specified) its children. However, it will be detached from the original's parents and siblings.
dom.go:486
↓ 1 callersFunctionCreateTextNode
CreateTextNode creates a new Text node.
dom.go:155
↓ 1 callersFunctionFirstElementChild
FirstElementChild returns the object's first child Element, or nil if there are no child elements.
dom.go:392
↓ 1 callersFunctionGetAllNodesWithTag
GetAllNodesWithTag is wrapper for GetElementsByTagName() which allow to get several tags at once.
dom.go:505
↓ 1 callersFunctionGetElementByID
GetElementByID returns a Node object representing the element whose id property matches the specified string.
dom.go:43
↓ 1 callersFunctionGetElementsByClassName
GetElementsByClassName returns an array of all child elements which have all of the given class name(s).
dom.go:77
↓ 1 callersFunctionID
ID returns the value of the id attribute of the specified element.
dom.go:350
↓ 1 callersFunctionIncludeNode
IncludeNode determines if node is included inside nodeList.
dom.go:475
↓ 1 callersFunctionInnerHTML
InnerHTML returns the HTML content (inner HTML) of an element. The returned HTML value is escaped.
dom.go:321
↓ 1 callersFunctionNextElementSibling
NextElementSibling returns the Element immediately following the specified one in its parent's children list, or nil if the specified Element is the l
dom.go:416
↓ 1 callersFunctionPreviousElementSibling
PreviousElementSibling returns the the Element immediately prior to the specified one in its parent's children list, or null if the specified element
dom.go:404
↓ 1 callersFunctionQuerySelectorAll
QuerySelectorAll returns array of document's elements that match the specified group of selectors.
dom.go:21
↓ 1 callersFunctionRemoveAttribute
RemoveAttribute removes attribute with given name.
dom.go:210
↓ 1 callersFunctionRemoveNodes
RemoveNodes iterates over a NodeList, calls `filterFn` for each node and removes node if function returned `true`. If function is not passed, removes
dom.go:523
↓ 1 callersFunctionSetAttribute
SetAttribute sets attribute for node. If attribute already exists, it will be replaced.
dom.go:190
↓ 1 callersFunctionSetInnerHTML
SetInnerHTML sets inner HTML of the specified node.
dom.go:553
↓ 1 callersFunctionnormalizeTextEncoding
normalizeTextEncoding convert text encoding from NFD to NFC. It also remove soft hyphen since apparently it's useless in web. See: https://web.archive
parser.go:56
FunctionDocumentElement
DocumentElement returns the Element that is the root element of the document. Since we are working with HTML document, the root will be <html> element
dom.go:342
FunctionFastParse
FastParse parses html.Node from the specified reader without caring about text encoding. It always assume that the input uses UTF-8 encoding.
parser.go:19
FunctionForEachNode
ForEachNode iterates over a NodeList and runs fn on each node.
dom.go:514
FunctionInnerText
InnerText in JS used to capture text from an element while excluding text from hidden children. A child is hidden if it's computed width is 0, whether
dom.go:265
FunctionParse
Parse parses html.Node from the specified reader while converting the character encoding into UTF-8. This function is useful to correctly parse web pa
parser.go:28
FunctionTestAppendChild
(t *testing.T)
dom_test.go:873
FunctionTestChildNodes
(t *testing.T)
dom_test.go:705
FunctionTestChildren
(t *testing.T)
dom_test.go:654
FunctionTestClassName
(t *testing.T)
dom_test.go:617
FunctionTestCloneNode
(t *testing.T)
dom_test.go:1066
FunctionTestCreateElement
(t *testing.T)
dom_test.go:235
FunctionTestCreateTextNode
(t *testing.T)
dom_test.go:284
FunctionTestFirstElementChild
(t *testing.T)
dom_test.go:760
FunctionTestGetAllNodesWithTag
(t *testing.T)
dom_test.go:1111
FunctionTestGetAttribute
(t *testing.T)
dom_test.go:302
FunctionTestGetElementByID
(t *testing.T)
dom_test.go:124
FunctionTestGetElementsByClassName
(t *testing.T)
dom_test.go:159
FunctionTestGetElementsByTagName
(t *testing.T)
dom_test.go:197
FunctionTestHasAttribute
(t *testing.T)
dom_test.go:431
FunctionTestId
(t *testing.T)
dom_test.go:588
FunctionTestIncludeNode
(t *testing.T)
dom_test.go:1023
FunctionTestInnerHTML
(t *testing.T)
dom_test.go:543
FunctionTestNextElementSibling
(t *testing.T)
dom_test.go:834
FunctionTestOuterHTML
(t *testing.T)
dom_test.go:508
FunctionTestPrependChild
(t *testing.T)
dom_test.go:927
FunctionTestPreviousElementSibling
(t *testing.T)
dom_test.go:795
FunctionTestQuerySelector
(t *testing.T)
dom_test.go:64
FunctionTestQuerySelectorAll
(t *testing.T)
dom_test.go:11
FunctionTestRemoveAttribute
(t *testing.T)
dom_test.go:392
FunctionTestRemoveNodes
(t *testing.T)
dom_test.go:1173
FunctionTestReplaceChild
(t *testing.T)
dom_test.go:981
FunctionTestSetAttribute
(t *testing.T)
dom_test.go:349
FunctionTestSetInnerHTML
(t *testing.T)
dom_test.go:1268
FunctionTestSetTextContent
(t *testing.T)
dom_test.go:1217
FunctionTestTextContent
(t *testing.T)
dom_test.go:463