maxiaoshan 3 years ago
parent
commit
718e70d67b
2 changed files with 3 additions and 1 deletions
  1. 1 1
      src/spiderutil/clearHtml.go
  2. 2 0
      src/spiderutil/sysconfig.go

+ 1 - 1
src/spiderutil/clearHtml.go

@@ -35,7 +35,7 @@ func NewCut() *Cut {
 	//sc, _ := regexp.Compile("\\<script[^\\>]*\\>*[^\\>]+\\</script\\>")
 	//ss, _ := regexp.Compile("\\<style[^\\>]*\\>*[^\\>]+\\</style\\>")
 	scs := regexp.MustCompile("(?s)<(script|style)[^>]*>.+?</(script|style)>")
-	at := regexp.MustCompile("(?s)<!%-%-.*?%-%->")
+	at := regexp.MustCompile("(?s)<(!%-%-|!--).*?(%-%-|--)>") //注释 css
 	hiddentag := regexp.MustCompile(`<\s*input[^<]*type=("|')hidden("|')[^<]*>`)
 	input := regexp.MustCompile(`<\s*input[^<]*value=("|')([^>"']*)[^<]*>`)
 	cols, _ := regexp.Compile(`colspan="\d+"`)

+ 2 - 0
src/spiderutil/sysconfig.go

@@ -76,6 +76,8 @@ type config struct {
 	PassWord string `json:"password"`
 	//邮件
 	JkMail map[string]string `json:"jkmail"`
+	//es
+	Es map[string]interface{} `json:"es"`
 }
 
 var Config config