nange / gospider

golang实现的爬虫框架,使用者只需关心页面规则,提供web管理界面。基于colly开发。
MIT License
403 stars 107 forks source link

调用 Attr 报错,newXMLElement 方法未对 el 赋值 #38

Closed onlywsx closed 5 years ago

onlywsx commented 5 years ago

func newXMLElement(el colly.XMLElement, ctx Context) *XMLElement { return &XMLElement{ Name: el.Name, Text: el.Text, Request: newRequest(el.Request, ctx), Response: newResponse(el.Response, ctx), DOM: el.DOM, el: el, } }

func (x *XMLElement) Attr(k string) string { return x.el.Attr(k) }

nange commented 5 years ago

thanks, fixed.