用 colly 迭代 HTMLElement 属性?
发布时间:2022-07-28 21:33:46 424
相关标签: # css
如HTML结构中所示,属性是私有属性:
// HTMLElement is the representation of a HTML tag.
type HTMLElement struct {
// Name is the name of the tag
Name string
Text string
attributes []html.Attribute
// Request is the request object of the element's HTML document
Request *Request
// Response is the Response object of the element's HTML document
Response *Response
// DOM is the goquery parsed DOM object of the page. DOM is relative
// to the current HTMLElement
DOM *goquery.Selection
// Index stores the position of the current element within all the elements matched by an OnHTML callback
Index int
}
有.Attr()用于获取单个属性的函数,但我将如何迭代所有属性?似乎没有明显的方法可以attributes从该结构访问或使用函数。
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报