-
Notifications
You must be signed in to change notification settings - Fork 8
/
response.go
27 lines (24 loc) · 732 Bytes
/
response.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package scrapemate
import (
"net/http"
"time"
)
// Response is the struct that it is returned when crawling finishes
type Response struct {
URL string
StatusCode int
Headers http.Header
Duration time.Duration
Body []byte
Error error
Meta map[string]any
Screenshot []byte
// Document is the parsed document
// if you don't set an html parser the document will be nil
// Since each html parser has it's own document type
// the document is an interface
// You need to cast it to the type of the parser you are using
// For example if you are using goquery you need to cast it to *goquery.Document
// If you are using the stdib parser net/html the it will be *html.Node
Document any
}