|
@@ -40,7 +40,7 @@ func GetReportContentTextSub(content string) (contentSub string, err error) {
|
|
fmt.Println("create doc err:", err.Error())
|
|
fmt.Println("create doc err:", err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- maxRow:=5
|
|
|
|
|
|
+ maxRow := 5
|
|
n := 0
|
|
n := 0
|
|
doc.Find("p").Each(func(i int, s *goquery.Selection) {
|
|
doc.Find("p").Each(func(i int, s *goquery.Selection) {
|
|
pHtml, _ := s.Html()
|
|
pHtml, _ := s.Html()
|
|
@@ -48,20 +48,26 @@ func GetReportContentTextSub(content string) (contentSub string, err error) {
|
|
if n > maxRow {
|
|
if n > maxRow {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- n++
|
|
|
|
- contentSub = contentSub + s.Text()
|
|
|
|
|
|
+ text := s.Text()
|
|
|
|
+ if !strings.Contains(text, "访谈时间") && !strings.Contains(text, "纪要详情") {
|
|
|
|
+ n++
|
|
|
|
+ contentSub = contentSub + s.Text()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
if contentSub == "" {
|
|
if contentSub == "" {
|
|
m := 0
|
|
m := 0
|
|
doc.Find("span").Each(func(i int, s *goquery.Selection) {
|
|
doc.Find("span").Each(func(i int, s *goquery.Selection) {
|
|
spanHtml, _ := s.Html()
|
|
spanHtml, _ := s.Html()
|
|
- if !strings.Contains(spanHtml, "img") && !strings.Contains(spanHtml, "table") {
|
|
|
|
|
|
+ if !strings.Contains(spanHtml, "img") && !strings.Contains(spanHtml, "table") {
|
|
if m > maxRow {
|
|
if m > maxRow {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- m++
|
|
|
|
- contentSub = contentSub + s.Text()
|
|
|
|
|
|
+ text := s.Text()
|
|
|
|
+ if !strings.Contains(text, "访谈时间") && !strings.Contains(text, "纪要详情") {
|
|
|
|
+ n++
|
|
|
|
+ contentSub = contentSub + s.Text()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|