Versions in this module Expand all Collapse all v0 v0.2.0 Oct 14, 2026 Changes in this version + var ErrHostBlocked = errors.New("forage: host blocked this client") + type BlockedError struct + At time.Time + Host string + Outcome detect.Outcome + Status int + URL string + func (e *BlockedError) Error() string + func (e *BlockedError) Is(target error) bool type Client + func (c *Client) BlockedHosts() []BlockedError type Config + UserAgent string v0.1.0 Oct 13, 2026 Changes in this version + var ErrDisallowed = errors.New("forage: disallowed by robots.txt") + type Client struct + func New(cfg Config) (*Client, error) + func (c *Client) Extract(res *Result, set extract.Set) (extract.Record, error) + func (c *Client) ExtractAll(res *Result, set extract.Set, itemCSS string) ([]extract.Record, error) + func (c *Client) Get(ctx context.Context, rawURL string) (*Result, error) + type Config struct + Browser fetch.Fetcher + BrowserOnBlock bool + Detector detect.Detector + HTTP fetch.Fetcher + IgnoreRobots bool + Limiter *pace.Limiter + Metrics metrics.Hook + NeedsJS func(detect.Page) bool + Pool *session.Pool + Retry pace.Policy + RobotsAgent string + RobotsTTL time.Duration + type DisallowedError struct + URL string + func (e *DisallowedError) Error() string + func (e *DisallowedError) Is(target error) bool + type Result struct + Attempts int + Body []byte + Header http.Header + Identity *session.Identity + Outcome detect.Outcome + Status int + URL string + Via Via + type Via string + const ViaBrowser + const ViaHTTP