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 := ...
分类:
Web程序 时间:
2015-08-19 09:27:25
阅读次数:
1937
刚开始爬取的时候是用正则表达式实现的,然后爬取了不必要的链接,现在改用goquery实现:
// judgeUrl project judgeUrl.go
package judgeUrl
import (
"strings"
)
func IsUrl(str string) bool {
if strings.HasPrefix(str, "#") || strings.HasPref...
分类:
Web程序 时间:
2015-07-31 15:03:38
阅读次数:
269
package?main
/*
?*?中文编码问题
?*/
import?(
"errors"
"flag"
"fmt"
query?"github.com/PuerkitoBio/goquery"
"golang.org/x/text/encoding/simplifiedchinese"
"io/ioutil"
"net/http"
"os"...
分类:
Web程序 时间:
2015-07-28 11:08:09
阅读次数:
154