Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NeedsRendering ¶
func NeedsRendering(mode DetectionMode, body []byte, staticData *parser.PageData) bool
NeedsRendering determines whether a page should be JS-rendered.
Types ¶
type DetectionMode ¶
type DetectionMode string
DetectionMode controls when JS rendering is applied.
const ( ModeOff DetectionMode = "off" ModeAuto DetectionMode = "auto" ModeAlways DetectionMode = "always" )
func ParseDetectionMode ¶
func ParseDetectionMode(s string) DetectionMode
ParseDetectionMode converts a string to a DetectionMode.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages a single Chrome browser with a pool of reusable pages.
func NewPool ¶
func NewPool(opts PoolOptions) (*Pool, error)
NewPool launches a headless Chrome and creates a page pool.
type PoolOptions ¶
type PoolOptions struct {
MaxPages int
PageTimeout time.Duration
UserAgent string
BlockResources bool
Headless bool
}
PoolOptions configures the Chrome page pool.
func DefaultPoolOptions ¶
func DefaultPoolOptions() PoolOptions
Click to show internal directories.
Click to hide internal directories.