test
This commit is contained in:
parent
2f570bbc82
commit
e66254e37c
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user