diff --git a/parser_test.go b/parser_test.go index cd1ce3e..46871ca 100644 --- a/parser_test.go +++ b/parser_test.go @@ -2,6 +2,8 @@ package parser import ( "encoding/json" + "log" + "strconv" "testing" ) @@ -24,6 +26,16 @@ func (tt *Toutiao) GetSpiderID() int { } func (tt *Toutiao) ToDoParser(adstring string) (string, error) { + + log.Println(adstring) + adstring = strconv.QuoteToASCII(adstring) + var addata map[string]interface{} + if err := json.Unmarshal([]byte(adstring), &addata); err != nil { + log.Println(err) + } + + log.Println(addata) + adparser := NewADParser(tt.GetSpiderID()) data, err := adparser.ToJSON() if err != nil {