Add custom actions for rendered requests & Fix not closing bug

This commit is contained in:
Musab Gültekin
2022-04-29 03:05:31 +03:00
parent 34d17a2d3d
commit 738852f932
7 changed files with 824 additions and 87 deletions

View File

@@ -1,6 +1,7 @@
package geziyor
import (
"github.com/chromedp/chromedp"
"github.com/geziyor/geziyor/cache"
"github.com/geziyor/geziyor/client"
"github.com/geziyor/geziyor/export"
@@ -74,6 +75,11 @@ type Options struct {
// ProxyFunc setting proxy for each request
ProxyFunc func(*http.Request) (*url.URL, error)
// Rendered requests pre actions. Setting this will override the existing default.
// And you'll need to handle all rendered actions, like navigation, waiting, response etc.
// If you need to make custom actions in addition to the defaults, use Request.Actions instead of this.
PreActions []chromedp.Action
// Request delays
RequestDelay time.Duration