package main import ( "encoding/json" "fmt" "github.com/PuerkitoBio/goquery" util "jygit.jydev.jianyu360.cn/data_processing/common_utils" "jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb" "log" "net/http" "strings" "testing" ) func TestGovWeb(T *testing.T) { //87 竞品` MgoLua := &mongodb.MongodbSim{ //MongodbAddr: "172.17.4.87:27080", MongodbAddr: "127.0.0.1:27081", Size: 10, DbName: "zxl", UserName: "", Password: "", Direct: true, } MgoLua.InitPool() sess := MgoLua.GetMgoConn() defer MgoLua.DestoryMongoConn(sess) it := sess.DB("zxl").C("excel").Find(nil).Select(nil).Iter() count := 0 for tmp := make(map[string]interface{}); it.Next(&tmp); count++ { if count%100 == 0 { log.Println("current:", count, tmp["name"], tmp["href"]) } where := map[string]interface{}{ "name": tmp["name"], "href": tmp["href"], "from": tmp["from"], } xd, _ := MgoLua.FindOne("xlsx_html_data", where) ins := *xd htmlContent := util.ObjToString(ins["html"]) doc, err := goquery.NewDocumentFromReader(strings.NewReader(htmlContent)) if err != nil { log.Fatal(err) } // 获取
STATE COUNCILORS:
\nSTATE COUNCILORS:
\n