diff --git a/export.go b/export.go index 8e33598..81f89c2 100644 --- a/export.go +++ b/export.go @@ -23,6 +23,8 @@ func Export(response *Response) { for res := range response.Exports { //fmt.Println(res) - _ = json.NewEncoder(file).Encode(res) + encoder := json.NewEncoder(file) + encoder.SetEscapeHTML(false) + encoder.Encode(res) } } diff --git a/geziyor.go b/geziyor.go index dec97d2..5c494a7 100644 --- a/geziyor.go +++ b/geziyor.go @@ -148,7 +148,7 @@ func (g *Geziyor) Do(req *http.Request) { Body: body, Doc: doc, Geziyor: g, - Exports: make(chan map[string]interface{}, 1), + Exports: make(chan interface{}, 1), } // Export Function diff --git a/geziyor_test.go b/geziyor_test.go index 92e07d8..16c5117 100644 --- a/geziyor_test.go +++ b/geziyor_test.go @@ -22,7 +22,8 @@ func TestGeziyor_IP(t *testing.T) { StartURLs: []string{"http://api.ipify.org"}, Cache: httpcache.NewMemoryCache(), ParseFunc: func(r *geziyor.Response) { - fmt.Println(string(r.Body)) + fmt.Println(r.Doc.Text()) + r.Exports <- r.Doc.Text() r.Geziyor.Get("http://api.ipify.org") }, }) diff --git a/response.go b/response.go index a847972..d64dc2a 100644 --- a/response.go +++ b/response.go @@ -14,7 +14,7 @@ type Response struct { Doc *goquery.Document Geziyor *Geziyor - Exports chan map[string]interface{} + Exports chan interface{} } // JoinURL joins base response URL and provided relative URL.