Go使用goquery获取url小实例
时间:2015-08-19 09:27:25
收藏:0
阅读:1937
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
)
func main() {
g, e := goquery.NewDocument("http://gold.3g.cnfol.com/")
if e != nil {
fmt.Println(e)
}
c := g.Find("ul")
s := c.Eq(6).Find("a")
s.Each(func(i int, content *goquery.Selection) {
a, _ := content.Attr("href")
fmt.Println(a)
})
}版权声明:本文为博主原创文章,未经博主允许不得转载。
评论(0)