{"id":29960573,"url":"https://github.com/pog7x/ssfactory","last_synced_at":"2026-04-17T02:32:07.294Z","repository":{"id":64298262,"uuid":"566412758","full_name":"pog7x/ssfactory","owner":"pog7x","description":"Simple screenshot factory","archived":false,"fork":false,"pushed_at":"2023-02-24T15:27:23.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T23:02:08.297Z","etag":null,"topics":["chromedriver","concurency","geckodriver","go","screenshot","selenium","webdriver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pog7x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-15T16:10:18.000Z","updated_at":"2022-11-15T17:33:20.000Z","dependencies_parsed_at":"2024-06-20T13:06:01.518Z","dependency_job_id":"8a4474aa-c64e-4760-a90d-28bd444b8e43","html_url":"https://github.com/pog7x/ssfactory","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pog7x/ssfactory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pog7x%2Fssfactory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pog7x%2Fssfactory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pog7x%2Fssfactory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pog7x%2Fssfactory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pog7x","download_url":"https://codeload.github.com/pog7x/ssfactory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pog7x%2Fssfactory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31912373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chromedriver","concurency","geckodriver","go","screenshot","selenium","webdriver"],"created_at":"2025-08-03T23:00:55.557Z","updated_at":"2026-04-17T02:32:07.268Z","avatar_url":"https://github.com/pog7x.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssfactory\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/pog7x/ssfactory.svg)](https://pkg.go.dev/github.com/pog7x/ssfactory)\n[![Build Status](https://github.com/pog7x/ssfactory/actions/workflows/go.yml/badge.svg)](https://github.com/pog7x/ssfactory/actions/workflows/go.yml)\n[![License: MIT](https://img.shields.io/github/license/pog7x/ssfactory)](https://github.com/pog7x/ssfactory/blob/master/LICENSE)\n\nConcurrent screenshot capture library for Go, powered by Selenium WebDriver and a built-in worker pool.\n\n## Features\n\n- **Browser support** — Chrome (via ChromeDriver) and Firefox (via GeckoDriver)\n- **Concurrency** — built-in worker pool for parallel screenshot jobs\n- **Element targeting** — capture specific DOM elements by ID, XPath, CSS selector, tag name, etc.\n- **Flexible output** — raw `[]byte` passed to your handler (save to disk, upload, encode — up to you)\n\n## Prerequisites\n\n| Dependency | Purpose |\n|---|---|\n| [ChromeDriver](https://chromedriver.chromium.org/) or [GeckoDriver](https://github.com/mozilla/geckodriver) | Browser automation driver |\n| Chrome or Firefox | Target browser binary |\n\n## Installation\n\n```bash\ngo get github.com/pog7x/ssfactory\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport \"github.com/pog7x/ssfactory\"\n\nfunc main() {\n\tf, stop, err := ssfactory.NewFactory(ssfactory.InitFactory{\n\t\tWebdriverPort:     9515,\n\t\tUseBrowser:        ssfactory.ChromeName,\n\t\tChromeBinaryPath:  \"/usr/bin/google-chrome\",\n\t\tChromedriverPath:  \"/usr/local/bin/chromedriver\",\n\t\tChromeArgs:        []string{\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"},\n\t\tWorkersCount:      4,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer stop()\n\n\tmaximize := \"\"\n\tf.MakeScreenshot(ssfactory.MakeScreenshotPayload{\n\t\tURL:            \"https://example.com\",\n\t\tDOMElementBy:   ssfactory.ByTagName,\n\t\tDOMElementName: \"body\",\n\t\tScroll:         true,\n\t\tMaximizeWindow: \u0026maximize,\n\t\tBytesHandler: func(b []byte) error {\n\t\t\t// save, upload, encode to PNG, etc.\n\t\t\treturn nil\n\t\t},\n\t})\n}\n```\n\n### Firefox example\n\n```go\nf, stop, err := ssfactory.NewFactory(ssfactory.InitFactory{\n\tWebdriverPort:     8080,\n\tUseBrowser:        ssfactory.FirefoxName,\n\tFirefoxBinaryPath: \"/usr/bin/firefox\",\n\tGeckodriverPath:   \"/usr/local/bin/geckodriver\",\n\tFirefoxArgs:       []string{\"--headless\", \"--width=1920\"},\n\tWorkersCount:      2,\n})\n```\n\n## API\n\n### Element selectors\n\n| Constant | Selenium strategy |\n|---|---|\n| `ByID` | `id` |\n| `ByXPATH` | `xpath` |\n| `ByLinkText` | `link text` |\n| `ByPartialLinkText` | `partial link text` |\n| `ByName` | `name` |\n| `ByTagName` | `tag name` |\n| `ByClassName` | `class name` |\n| `ByCSSSelector` | `css selector` |\n\n### `MakeScreenshotPayload`\n\n| Field | Type | Description |\n|---|---|---|\n| `URL` | `string` | Page URL to navigate to |\n| `DOMElementBy` | `string` | Selector strategy (see table above) |\n| `DOMElementName` | `string` | Selector value |\n| `Scroll` | `bool` | Scroll element into view before capture |\n| `MaximizeWindow` | `*string` | Maximize window handle (pass `nil` to skip) |\n| `Timeout` | `time.Duration` | Wait timeout before capturing |\n| `BytesHandler` | `func([]byte) error` | Callback receiving screenshot bytes |\n\n## License\n\n[MIT](LICENSE) — Copyright (c) 2022 pog7x\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpog7x%2Fssfactory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpog7x%2Fssfactory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpog7x%2Fssfactory/lists"}