Documentation
¶
Overview ¶
Package scrape provides tools to scrape web page content using Playwright and convert the results to Markdown.
Index ¶
- Variables
- type Browser
- type Option
- func WithIgnoreHttpsErrors(on bool) Option
- func WithLocale(loc string) Option
- func WithMaxAge(d time.Duration) Option
- func WithMaxSpeed(d time.Duration) Option
- func WithReferer(ref string) Option
- func WithTimeout(d time.Duration) Option
- func WithTimezone(zone string) Option
- func WithWaitFor(d time.Duration) Option
- func WithWaitUntil(s *playwright.WaitUntilState) Option
- type Options
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ Timeout: 15 * time.Second, MaxAge: 8 * time.Hour, MaxSpeed: time.Second, WaitUntil: *playwright.WaitUntilStateLoad, Locale: "en-GB", Timezone: "Europe/London", IgnoreHttpsErrors: true, }
Default options if not overridden in NewBrowser or Scrape calls
Functions ¶
This section is empty.
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser instance with default options and cache.
type Option ¶
type Option func(*Options)
func WithIgnoreHttpsErrors ¶
func WithLocale ¶
func WithMaxAge ¶
func WithMaxSpeed ¶
func WithReferer ¶
func WithTimeout ¶
func WithTimezone ¶
func WithWaitFor ¶
func WithWaitUntil ¶
func WithWaitUntil(s *playwright.WaitUntilState) Option
type Options ¶
type Options struct {
Timeout time.Duration // Timeout for each goto request
MaxAge time.Duration // Used cached response if age of request less than this
MaxSpeed time.Duration // Minimum delay between requests from same host
WaitFor time.Duration // Wait after load has completed
WaitUntil playwright.WaitUntilState
Referer string
Locale string
Timezone string
IgnoreHttpsErrors bool
}
Options for playwright browser.
Click to show internal directories.
Click to hide internal directories.