fix page crawling encoding

This commit is contained in:
nkanaev
2022-01-24 14:02:08 +00:00
parent b78c8bf8bf
commit e3e9542f1e
3 changed files with 20 additions and 3 deletions

View File

@@ -50,3 +50,16 @@ func init() {
userAgent: "Yarr/1.0",
}
}
func GetHTTP(url string) (*http.Response, error) {
res, err := client.get(url)
if err != nil {
return nil, err
}
body, err := httpBody(res)
if err != nil {
return nil, err
}
res.Body = body
return res, nil
}