package extractor import ( "context" "io" ) type OpenPageOptions struct { Referer string // AllowNonOKStatus, when true, keeps the page open and returns a usable // Document along with ErrInvalidStatusCode on non-2xx responses (other // than 404, which is treated as ErrPageNotFound and still closes the // page). This lets callers promote the page to an InteractiveBrowser // to e.g. let a human solve a Cloudflare captcha that produced a 403, // then resume extraction from the same browser instance. AllowNonOKStatus bool } type Browser interface { io.Closer Open(ctx context.Context, url string, opts OpenPageOptions) (Document, error) }