package main
import "github.com/pog7x/ssfactory"
func someActionsOnBytes(screenshotBytes []byte) error {
// Some actions on bytes (encode to png, send via http/rmq etc.)
return nil
}
func main() {
f, stopFunc, err := ssfactory.NewFactory(
ssfactory.InitFactory{
WebdriverPort: 8080,
UseBrowser: "firefox",
FirefoxBinaryPath: "/usr/bin/firefox",
GeckodriverPath: "./dependencies/geckodriver",
FirefoxArgs: []string{
"--headless",
"--no-sandbox",
"--disable-dev-shm-usage",
"--width=1920",
},
},
)
if err != nil {
panic("initialization screenshot factory error")
}
defer stopFunc()
var maximize string
f.MakeScreenshot(
ssfactory.MakeScreenshotPayload{
URL: "https://github.com",
DOMElementBy: ssfactory.ByTagName,
DOMElementName: "body",
Scroll: true,
BytesHandler: someActionsOnBytes,
MaximizeWindow: &maximize,
},
)
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Simple screenshot factory
License
pog7x/ssfactory
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple screenshot factory
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published