提交 15b8e356 编写于 作者: S shi.zeyuan

1.xxx

上级 33b19bea
......@@ -14,7 +14,7 @@ func main() {
parse2 := add.Format( "2006")
fmt.Println(parse)
fmt.Println(parse2)
launch.Spider_leagueSeason()
launch.Spider_match_his("2019")
launch.Spider_History()
}
......
......@@ -29,16 +29,20 @@ func GetLeagueSeasonProcesser() *LeagueSeasonProcesser {
return &LeagueSeasonProcesser{}
}
func (this *LeagueSeasonProcesser) Startup() {
func (this *LeagueSeasonProcesser) Init() {
//初始化参数值
this.leagueSeason_list = make([]*pojo.LeagueSeason, 0)
this.leagueSub_list = make([]*pojo.LeagueSub, 0)
this.sUrl_leagueId = make(map[string]string)
}
func (this *LeagueSeasonProcesser) Startup() {
this.Init()
//1.获取所有的联赛
leaguesList := make([]*pojo.League, 0)
this.LeagueService.FindAll(&leaguesList)
//2.配置要抓取的路径
newSpider := spider.NewSpider(this, "LeagueSeasonProcesser")
//index := 0
......@@ -84,14 +88,13 @@ func (this *LeagueSeasonProcesser) Process(p *page.Page) {
return
}
//1.处理season
leagueId := this.sUrl_leagueId[request.Url]
htmlParser := p.GetHtmlParser()
this.season_process(htmlParser, request.Url)
this.season_process(htmlParser,leagueId, request.Url)
}
func (this *LeagueSeasonProcesser) season_process(htmlParser *goquery.Document, url string) {
leagueId := this.sUrl_leagueId[url]
func (this *LeagueSeasonProcesser) season_process(htmlParser *goquery.Document, leagueId string,url string) {
//获取赛季开始的月份
var beginMonth int
if strings.Contains(url, "-") {
......
......@@ -88,7 +88,9 @@ func (this *MatchHisProcesser) Process(p *page.Page) {
}
//1.处理season
htmlParser := p.GetHtmlParser()
this.season_process(htmlParser, request.Url)
leagueId := this.sUrl_leagueId[request.Url]
this.LeagueSeasonProcesser.Init()
this.LeagueSeasonProcesser.season_process(htmlParser, leagueId,request.Url)
//1.处理比赛
season := this.sUrl_Season[request.Url]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册