Documentation ¶
Index ¶
- Constants
- func GetChildComment(startingPoint *html.Node) (childNode *html.Node)
- func GetChildElement(startingPoint *html.Node) (childNode *html.Node)
- func GetChildNodeByTag(startingPoint *html.Node, tagName string) (childNode *html.Node)
- func GetChildNodeByTagAndClass(startingPoint *html.Node, tagName string, className string) (childNode *html.Node)
- func GetChildNodeByTagAndId(startingPoint *html.Node, tagName string, idName string) (childNode *html.Node)
- func GetChildNodeByType(startingPoint *html.Node, nodeType html.NodeType) (childNode *html.Node)
- func GetChildNodes(startingPoint *html.Node) (childNodes []*html.Node)
- func GetChildValue(startingPoint *html.Node) (childNode *html.Node)
- func GetChildValueNE(startingPoint *html.Node) (childNode *html.Node)
- func GetCleanValue(node *html.Node) (cleanValue string)
- func GetInnerHtml(node *html.Node) (innerHtml string, err error)
- func GetNodeAttributeValue(node *html.Node, attributeName string) (attributeValue string, attributeExists bool)
- func GetOuterHtml(node *html.Node) (outerHtml string, err error)
- func GetSiblingComment(startingPoint *html.Node) (siblingNode *html.Node)
- func GetSiblingElement(startingPoint *html.Node) (siblingNode *html.Node)
- func GetSiblingNodeByTag(startingPoint *html.Node, tagName string) (siblingNode *html.Node)
- func GetSiblingNodeByTagAndClass(startingPoint *html.Node, tagName string, className string) (siblingNode *html.Node)
- func GetSiblingNodeByTagAndId(startingPoint *html.Node, tagName string, idName string) (siblingNode *html.Node)
- func GetSiblingNodeByType(startingPoint *html.Node, nodeType html.NodeType) (siblingNode *html.Node)
- func GetSiblingValue(startingPoint *html.Node) (siblingNode *html.Node)
- func GetSiblingValueNE(startingPoint *html.Node) (siblingNode *html.Node)
- func HasNonEmptyValue(node *html.Node) bool
- func NodeHasAttribute(node *html.Node, attributeName string) (attributeExists bool)
Constants ¶
const ( AttributeAccept = "accept" AttributeAcceptCharset = "accept-charset" AttributeAccesskey = "accesskey" AttributeAction = "action" AttributeAlign = "align" // Not supported in HTML 5. AttributeAllow = "allow" AttributeAlt = "alt" AttributeAsync = "async" AttributeAutocapitalize = "autocapitalize" AttributeAutocomplete = "autocomplete" AttributeAutofocus = "autofocus" AttributeAutoplay = "autoplay" AttributeBackground = "background" AttributeBgcolor = "bgcolor" // Not supported in HTML 5. AttributeBorder = "border" // Not supported in HTML 5. AttributeBuffered = "buffered" AttributeCapture = "capture" AttributeChallenge = "challenge" AttributeCharset = "charset" AttributeChecked = "checked" AttributeCite = "cite" AttributeClass = "class" AttributeCode = "code" AttributeCodebase = "codebase" AttributeColor = "color" // Not supported in HTML 5. AttributeCols = "cols" AttributeColspan = "colspan" AttributeContent = "content" AttributeContenteditable = "contenteditable" AttributeControls = "controls" AttributeCoords = "coords" AttributeCrossorigin = "crossorigin" AttributeCsp = "csp " AttributeData = "data" AttributeDataPrefix = "data-" AttributeDatetime = "datetime" AttributeDecoding = "decoding" AttributeDefault = "default" AttributeDefer = "defer" AttributeDir = "dir" AttributeDirname = "dirname" AttributeDisabled = "disabled" AttributeDownload = "download" AttributeDraggable = "draggable" AttributeDropzone = "dropzone" // Not mentioned on Mozilla's Website. AttributeEnctype = "enctype" AttributeEnterkeyhint = "enterkeyhint " AttributeFor = "for" AttributeForm = "form" AttributeFormaction = "formaction" AttributeFormenctype = "formenctype" AttributeFormmethod = "formmethod" AttributeFormnovalidate = "formnovalidate" AttributeFormtarget = "formtarget" AttributeHeaders = "headers" AttributeHeight = "height" AttributeHidden = "hidden" AttributeHigh = "high" AttributeHref = "href" AttributeHreflang = "hreflang" AttributeHttpEquiv = "http-equiv" AttributeIcon = "icon" // Not mentioned on Mozilla's Website. AttributeId = "id" AttributeImportance = "importance " AttributeIntegrity = "integrity" AttributeIntrinsicsize = "intrinsicsize " AttributeInputmode = "inputmode" AttributeIsmap = "ismap" AttributeItemprop = "itemprop" AttributeKeytype = "keytype" AttributeKind = "kind" AttributeLabel = "label" AttributeLang = "lang" AttributeLanguage = "language" AttributeLoading = "loading " AttributeList = "list" AttributeLoop = "loop" AttributeLow = "low" AttributeManifest = "manifest" AttributeMax = "max" AttributeMaxlength = "maxlength" AttributeMinlength = "minlength" AttributeMedia = "media" AttributeMethod = "method" AttributeMin = "min" AttributeMultiple = "multiple" AttributeMuted = "muted" AttributeName = "name" AttributeNovalidate = "novalidate" // Events. AttributeOnabort = "onabort" AttributeOnafterprint = "onafterprint" AttributeOnbeforeprint = "onbeforeprint" AttributeOnbeforeunload = "onbeforeunload" AttributeOnblur = "onblur" AttributeOncanplay = "oncanplay" AttributeOncanplaythrough = "oncanplaythrough" AttributeOnchange = "onchange" AttributeOnclick = "onclick" AttributeOncopy = "oncopy" AttributeOncuechange = "oncuechange" AttributeOncut = "oncut" AttributeOndblclick = "ondblclick" AttributeOndrag = "ondrag" AttributeOndragend = "ondragend" AttributeOndragenter = "ondragenter" AttributeOndragleave = "ondragleave" AttributeOndragover = "ondragover" AttributeOndragstart = "ondragstart" AttributeOndrop = "ondrop" AttributeOndurationchange = "ondurationchange" AttributeOnemptied = "onemptied" AttributeOnended = "onended" AttributeOnerror = "onerror" AttributeOnfocus = "onfocus" AttributeOnhashchange = "onhashchange" AttributeOninput = "oninput" AttributeOninvalid = "oninvalid" AttributeOnkeydown = "onkeydown" AttributeOnkeypress = "onkeypress" AttributeOnkeyup = "onkeyup" AttributeOnload = "onload" AttributeOnloadeddata = "onloadeddata" AttributeOnloadedmetadata = "onloadedmetadata" AttributeOnloadstart = "onloadstart" AttributeOnmousedown = "onmousedown" AttributeOnmousemove = "onmousemove" AttributeOnmouseout = "onmouseout" AttributeOnmouseover = "onmouseover" AttributeOnmouseup = "onmouseup" AttributeOnmousewheel = "onmousewheel" AttributeOnoffline = "onoffline" AttributeOnonline = "ononline" AttributeOnpagehide = "onpagehide" AttributeOnpageshow = "onpageshow" AttributeOnpaste = "onpaste" AttributeOnpause = "onpause" AttributeOnplay = "onplay" AttributeOnplaying = "onplaying" AttributeOnpopstate = "onpopstate" AttributeOnprogress = "onprogress" AttributeOnratechange = "onratechange" AttributeOnreset = "onreset" AttributeOnresize = "onresize" AttributeOnscroll = "onscroll" AttributeOnsearch = "onsearch" AttributeOnseeked = "onseeked" AttributeOnseeking = "onseeking" AttributeOnselect = "onselect" AttributeOnstalled = "onstalled" AttributeOnstorage = "onstorage" AttributeOnsubmit = "onsubmit" AttributeOnsuspend = "onsuspend" AttributeOntimeupdate = "ontimeupdate" AttributeOntoggle = "ontoggle" AttributeOnunload = "onunload" AttributeOnvolumechange = "onvolumechange" AttributeOnwaiting = "onwaiting" AttributeOnwheel = "onwheel" AttributeOpen = "open" AttributeOptimum = "optimum" AttributePattern = "pattern" AttributePing = "ping" AttributePlaceholder = "placeholder" AttributePlaysinline = "playsinline" AttributePoster = "poster" AttributePreload = "preload" AttributeRadiogroup = "radiogroup" // Not mentioned on Mozilla's Website. AttributeReadonly = "readonly" AttributeReferrerpolicy = "referrerpolicy" AttributeRel = "rel" AttributeRequired = "required" AttributeReversed = "reversed" AttributeRole = "role" AttributeRows = "rows" AttributeRowspan = "rowspan" AttributeSandbox = "sandbox" AttributeScope = "scope" AttributeScoped = "scoped" AttributeSelected = "selected" AttributeShape = "shape" AttributeSize = "size" AttributeSizes = "sizes" AttributeSlot = "slot" AttributeSpan = "span" AttributeSpellcheck = "spellcheck" AttributeSrc = "src" AttributeSrcdoc = "srcdoc" AttributeSrclang = "srclang" AttributeSrcset = "srcset" AttributeStart = "start" AttributeStep = "step" AttributeStyle = "style" AttributeSummary = "summary" AttributeTabindex = "tabindex" AttributeTarget = "target" AttributeTitle = "title" AttributeTranslate = "translate" AttributeType = "type" AttributeUsemap = "usemap" AttributeValue = "value" AttributeWidth = "width" AttributeWrap = "wrap" )
HTML Attributes.
const ( ErrUnsupportedNodeType = "unsupported node type" ErrNodeIsNotSet = "node is not set" ErrDomNodeIsNotFound = "DOM node is not found" ErrStartingPointIsNotSet = "starting point node is not set" )
const ( TagA = "a" TagAbbr = "abbr" TagAcronym = "acronym" // Not supported in HTML5. TagAddress = "address" TagApplet = "applet" // Not supported in HTML5. TagArea = "area" TagArticle = "article" TagAside = "aside" TagAudio = "audio" TagB = "b" TagBase = "base" TagBasefont = "basefont" // Not supported in HTML5. TagBdi = "bdi" TagBdo = "bdo" TagBig = "big" // Not supported in HTML5. TagBlockquote = "blockquote" TagBody = "body" TagBr = "br" TagButton = "button" TagCanvas = "canvas" TagCaption = "caption" TagCenter = "center" // Not supported in HTML5. TagCite = "cite" TagCode = "code" TagCol = "col" TagColgroup = "colgroup" TagData = "data" TagDatalist = "datalist" TagDd = "dd" TagDel = "del" TagDetails = "details" TagDfn = "dfn" TagDialog = "dialog" TagDir = "dir" // Not supported in HTML5. TagDiv = "div" TagDl = "dl" TagDt = "dt" TagEm = "em" TagEmbed = "embed" TagFieldset = "fieldset" TagFigure = "figure" TagFont = "font" // Not supported in HTML5. TagForm = "form" TagFrame = "frame" // Not supported in HTML5. TagFrameset = "frameset" // Not supported in HTML5. TagH1 = "h1" TagH2 = "h2" TagH3 = "h3" TagH4 = "h4" TagH5 = "h5" TagH6 = "h6" TagHead = "head" TagHeader = "header" TagHr = "hr" TagHtml = "html" TagI = "i" TagIframe = "iframe" TagImg = "img" TagInput = "input" TagIns = "ins" TagKbd = "kbd" TagLabel = "label" TagLegend = "legend" TagLi = "li" TagLink = "link" TagMain = "main" TagMap = "map" TagMark = "mark" TagMeta = "meta" TagMeter = "meter" TagNoframes = "noframes" // Not supported in HTML5. TagNoscript = "noscript" TagObject = "object" TagOl = "ol" TagOptgroup = "optgroup" TagOption = "option" TagOutput = "output" TagP = "p" TagParam = "param" TagPicture = "picture" TagPre = "pre" TagProgress = "progress" TagQ = "q" TagRb = "rb" TagRp = "rp" TagRt = "rt" TagRtc = "rtc" TagRuby = "ruby" TagS = "s" TagSamp = "samp" TagScript = "script" TagSection = "section" TagSelect = "select" TagSmall = "small" TagSource = "source" TagSpan = "span" TagStrike = "strike" // Not supported in HTML5. TagStrong = "strong" TagStyle = "style" TagSub = "sub" TagSummary = "summary" TagSup = "sup" TagSvg = "svg" TagTable = "table" TagTbody = "tbody" TagTd = "td" TagTemplate = "template" TagTextarea = "textarea" TagTfoot = "tfoot" TagTh = "th" TagThead = "thead" TagTime = "time" TagTitle = "title" TagTr = "tr" TagTrack = "track" TagTt = "tt" // Not supported in HTML5. TagU = "u" TagUl = "ul" TagVar = "var" TagVideo = "video" TagWbr = "wbr" )
HTML Tags.
Variables ¶
This section is empty.
Functions ¶
func GetChildComment ¶ added in v0.4.0
GetChildComment searches for the nearest child comment.
func GetChildElement ¶ added in v0.4.0
GetChildElement searches for the nearest child element.
func GetChildNodeByTag ¶
GetChildNodeByTag searches for the nearest child node having the specified tag name.
func GetChildNodeByTagAndClass ¶
func GetChildNodeByTagAndClass(startingPoint *html.Node, tagName string, className string) (childNode *html.Node)
GetChildNodeByTagAndClass searches for the nearest child node having the specified tag name and class.
func GetChildNodeByTagAndId ¶
func GetChildNodeByTagAndId(startingPoint *html.Node, tagName string, idName string) (childNode *html.Node)
GetChildNodeByTagAndId searches for the nearest child node having the specified tag name and id.
func GetChildNodeByType ¶ added in v0.4.0
GetChildNodeByType searches for the nearest child having the specified node type.
func GetChildNodes ¶ added in v0.4.0
GetChildNodes returns all child nodes.
func GetChildValue ¶ added in v0.4.0
GetChildValue searches for the nearest child [text] value.
func GetChildValueNE ¶ added in v0.4.0
GetChildValueNE searches for the nearest child [text] value which is not empty.
func GetCleanValue ¶ added in v0.4.0
func GetInnerHtml ¶ added in v0.4.0
func GetNodeAttributeValue ¶
func GetNodeAttributeValue(node *html.Node, attributeName string) (attributeValue string, attributeExists bool)
GetNodeAttributeValue gets the value of an attribute specified by its name.
func GetOuterHtml ¶ added in v0.4.0
func GetSiblingComment ¶ added in v0.4.0
GetSiblingComment searches for the nearest sibling comment.
func GetSiblingElement ¶ added in v0.4.0
GetSiblingElement searches for the nearest sibling element.
func GetSiblingNodeByTag ¶
GetSiblingNodeByTag searches for the nearest sibling node having the specified tag name.
func GetSiblingNodeByTagAndClass ¶
func GetSiblingNodeByTagAndClass(startingPoint *html.Node, tagName string, className string) (siblingNode *html.Node)
GetSiblingNodeByTagAndClass searches for the nearest sibling node having the specified tag name and class.
func GetSiblingNodeByTagAndId ¶
func GetSiblingNodeByTagAndId(startingPoint *html.Node, tagName string, idName string) (siblingNode *html.Node)
GetSiblingNodeByTagAndId searches for the nearest sibling node having the specified tag name and ID.
func GetSiblingNodeByType ¶ added in v0.4.0
func GetSiblingNodeByType(startingPoint *html.Node, nodeType html.NodeType) (siblingNode *html.Node)
GetSiblingNodeByType searches for the nearest sibling having the specified node type.
func GetSiblingValue ¶ added in v0.4.0
GetSiblingValue searches for the nearest sibling [text] value.
func GetSiblingValueNE ¶ added in v0.4.0
GetSiblingValueNE searches for the nearest sibling [text] value which is not empty.
func HasNonEmptyValue ¶ added in v0.4.0
Types ¶
This section is empty.