This commit is contained in:
eson 2018-12-20 01:48:24 +08:00
parent 961b0a758e
commit 57f2979264

View File

@ -3,6 +3,7 @@ package parser
import ( import (
"encoding/json" "encoding/json"
"log" "log"
"strconv"
"testing" "testing"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
@ -29,6 +30,7 @@ func (tt *Toutiao) GetSpiderID() int {
func (tt *Toutiao) ToDoParser(adstring string) (string, error) { func (tt *Toutiao) ToDoParser(adstring string) (string, error) {
log.Println(adstring) log.Println(adstring)
adstring = strconv.Quote(adstring)
var adlist interface{} var adlist interface{}
if err := json.Unmarshal([]byte(adstring), &adlist); err != nil { if err := json.Unmarshal([]byte(adstring), &adlist); err != nil {
log.Println(err) log.Println(err)