Configure headless browser address
Add `browser_address` configuration setting to define where is the headless browser instead of relying on the default value. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
6f002f007d
commit
45025def65
5 changed files with 11 additions and 9 deletions
|
@ -22,7 +22,7 @@ type Parser struct {
|
|||
}
|
||||
|
||||
// NewParser to create a new Parser instance
|
||||
func NewParser(includeRegex string, excludeRegex string) (*Parser, error) {
|
||||
func NewParser(browserAddress string, includeRegex string, excludeRegex string) (*Parser, error) {
|
||||
var err error
|
||||
var includeRegexCompiled, excludeRegexCompiled *regexp.Regexp
|
||||
|
||||
|
@ -44,7 +44,7 @@ func NewParser(includeRegex string, excludeRegex string) (*Parser, error) {
|
|||
|
||||
log.Debugf("creating context with headless browser drivers")
|
||||
ctx := context.Background()
|
||||
ctx = drivers.WithContext(ctx, cdp.NewDriver())
|
||||
ctx = drivers.WithContext(ctx, cdp.NewDriver(cdp.WithAddress(browserAddress)))
|
||||
ctx = drivers.WithContext(ctx, http.NewDriver(), drivers.AsDefault())
|
||||
|
||||
return &Parser{
|
||||
|
|
Reference in a new issue