![](https://img.kancloud.cn/99/6c/996c1466cb0b8e1cd5da9fbd7029f07c_1075x46.png)
有些图片地址在懒加载属性中,需要这样设置
~~~
package main
import (
articleSpider "github.com/PeterYangs/article-spider/v3"
)
func main() {
f := articleSpider.Form{
Host: "http://www.lfdsw.cn",
Channel: "/game/page/[PAGE]/",
PageStart: 1,
Length: 3,
ListSelector: "body > main > div > div.category.uk-background-muted.uk-margin-bottom > div > div.uk-grid-small.uk-grid > div",
HrefSelector: " div > a.icon",
ListFields: map[string]articleSpider.Field{
"img": {Types: articleSpider.Image, Selector: " div > a.icon > img"},
},
LazyImageAttrName: "data-src",
}
s := articleSpider.NewSpider(f, articleSpider.Normal)
s.Start()
}
~~~
>[info]**LazyImageAttrName**设置懒加载属性