Add support for setting cookies in the scraper (#934)

This commit is contained in:
bnkai
2020-12-01 07:34:09 +02:00
committed by GitHub
parent aecbd236bc
commit a96ab9ce6f
5 changed files with 230 additions and 4 deletions

View File

@@ -157,9 +157,22 @@ type scraperDebugOptions struct {
PrintHTML bool `yaml:"printHTML"`
}
type scraperCookies struct {
Name string `yaml:"Name"`
Value string `yaml:"Value"`
Domain string `yaml:"Domain"`
Path string `yaml:"Path"`
}
type cookieOptions struct {
CookieURL string `yaml:"CookieURL"`
Cookies []*scraperCookies `yaml:"Cookies"`
}
type scraperDriverOptions struct {
UseCDP bool `yaml:"useCDP"`
Sleep int `yaml:"sleep"`
UseCDP bool `yaml:"useCDP"`
Sleep int `yaml:"sleep"`
Cookies []*cookieOptions `yaml:"cookies"`
}
func loadScraperFromYAML(id string, reader io.Reader) (*config, error) {