func get_fund(code string) (string, error) {
url := "http://fundf10.eastmoney.com/jjjz_"+code+".html"
resp, err := http.Get(url)
if err != nil {
return " ", err
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return " ", err
}
fmt.Println(string(body))
return string(body), nil
}
使用string类型的body,可以爬下来整个网页。但是因为已经好久没接触过前端的使用,所以暂时先爬取到这里。