{"id":13493388,"url":"https://github.com/playwright-community/playwright-go","last_synced_at":"2025-12-30T04:43:42.129Z","repository":{"id":37015694,"uuid":"287942241","full_name":"playwright-community/playwright-go","owner":"playwright-community","description":"Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.","archived":false,"fork":false,"pushed_at":"2025-05-05T13:27:34.000Z","size":32638,"stargazers_count":2642,"open_issues_count":51,"forks_count":180,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-05-07T00:06:02.960Z","etag":null,"topics":["automation","browser-automation","chromium","firefox","go","golang","hacktoberfest","headless","headless-chrome","playwright","selenium","webkit"],"latest_commit_sha":null,"homepage":"https://playwright-community.github.io/playwright-go/","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/playwright-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"mxschmitt"}},"created_at":"2020-08-16T12:46:14.000Z","updated_at":"2025-05-06T18:37:44.000Z","dependencies_parsed_at":"2023-10-31T03:27:50.953Z","dependency_job_id":"3d3dcd7c-023a-4c77-b336-d4400b02cea7","html_url":"https://github.com/playwright-community/playwright-go","commit_stats":{"total_commits":226,"total_committers":20,"mean_commits":11.3,"dds":0.5132743362831859,"last_synced_commit":"7530f86d937da6a2821a43e496fc5ca0925a4349"},"previous_names":["mxschmitt/playwright-golang","mxschmitt/playwright-go"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fplaywright-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fplaywright-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fplaywright-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playwright-community%2Fplaywright-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playwright-community","download_url":"https://codeload.github.com/playwright-community/playwright-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929359,"owners_count":21985802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation","browser-automation","chromium","firefox","go","golang","hacktoberfest","headless","headless-chrome","playwright","selenium","webkit"],"created_at":"2024-07-31T19:01:14.757Z","updated_at":"2025-12-30T04:43:42.074Z","avatar_url":"https://github.com/playwright-community.png","language":"Go","funding_links":["https://github.com/sponsors/mxschmitt"],"categories":["Go","Testing","Core Libraries","Repositories","Language Support","Mock"],"sub_categories":["Selenium and browser control tools.","Go","Selenium and browser control tools"],"readme":"# 🎭 [Playwright](https://github.com/microsoft/playwright#readme) for \u003cimg src=\"https://user-images.githubusercontent.com/17984549/91302719-343a1d80-e7a7-11ea-8d6a-9448ef598420.png\" height=\"35\" /\u003e\n\n## Looking for maintainers and see [here](https://github.com/playwright-community/playwright-go/issues/122). Thanks!\n\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/playwright-community/playwright-go)](https://pkg.go.dev/github.com/playwright-community/playwright-go)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n[![Go Report Card](https://goreportcard.com/badge/github.com/playwright-community/playwright-go)](https://goreportcard.com/report/github.com/playwright-community/playwright-go) ![Build Status](https://github.com/playwright-community/playwright-go/workflows/Go/badge.svg)\n[![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) [![Coverage Status](https://coveralls.io/repos/github/playwright-community/playwright-go/badge.svg?branch=main)](https://coveralls.io/github/playwright-community/playwright-go?branch=main) \u003c!-- GEN:chromium-version-badge --\u003e[![Chromium version](https://img.shields.io/badge/chromium-134.0.6998.35-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)\u003c!-- GEN:stop --\u003e \u003c!-- GEN:firefox-version-badge --\u003e[![Firefox version](https://img.shields.io/badge/firefox-135.0-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)\u003c!-- GEN:stop --\u003e \u003c!-- GEN:webkit-version-badge --\u003e[![WebKit version](https://img.shields.io/badge/webkit-18.4-blue.svg?logo=safari)](https://webkit.org/)\u003c!-- GEN:stop --\u003e\n\n[API reference](https://playwright.dev/docs/api/class-playwright) | [Example recipes](https://github.com/playwright-community/playwright-go/tree/main/examples)\n\nPlaywright is a Go library to automate [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**.\n\n|          | Linux | macOS | Windows |\n|   :---   | :---: | :---: | :---:   |\n| Chromium \u003c!-- GEN:chromium-version --\u003e134.0.6998.35\u003c!-- GEN:stop --\u003e | ✅ | ✅ | ✅ |\n| WebKit \u003c!-- GEN:webkit-version --\u003e18.4\u003c!-- GEN:stop --\u003e | ✅ | ✅ | ✅ |\n| Firefox \u003c!-- GEN:firefox-version --\u003e135.0\u003c!-- GEN:stop --\u003e | ✅ | ✅ | ✅ |\n\nHeadless execution is supported for all the browsers on all platforms.\n\n## Installation\n\n```txt\ngo get -u github.com/playwright-community/playwright-go\n```\n\nInstall the browsers and OS dependencies:\n\n```bash\ngo run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps\n# Or\ngo install github.com/playwright-community/playwright-go/cmd/playwright@latest\nplaywright install --with-deps\n```\n\nAlternatively you can do it inside your program via which downloads the driver and browsers:\n\n```go\nerr := playwright.Install()\n```\n\n## Capabilities\n\nPlaywright is built to automate the broad and growing set of web browser capabilities used by Single Page Apps and Progressive Web Apps.\n\n* Scenarios that span multiple page, domains and iframes\n* Auto-wait for elements to be ready before executing actions (like click, fill)\n* Intercept network activity for stubbing and mocking network requests\n* Emulate mobile devices, geolocation, permissions\n* Support for web components via shadow-piercing selectors\n* Native input events for mouse and keyboard\n* Upload and download files\n\n## Example\n\nThe following example crawls the current top voted items from [Hacker News](https://news.ycombinator.com).\n\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/playwright-community/playwright-go\"\n)\n\nfunc main() {\n\tpw, err := playwright.Run()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not start playwright: %v\", err)\n\t}\n\tbrowser, err := pw.Chromium.Launch()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not launch browser: %v\", err)\n\t}\n\tpage, err := browser.NewPage()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not create page: %v\", err)\n\t}\n\tif _, err = page.Goto(\"https://news.ycombinator.com\"); err != nil {\n\t\tlog.Fatalf(\"could not goto: %v\", err)\n\t}\n\tentries, err := page.Locator(\".athing\").All()\n\tif err != nil {\n\t\tlog.Fatalf(\"could not get entries: %v\", err)\n\t}\n\tfor i, entry := range entries {\n\t\ttitle, err := entry.Locator(\"td.title \u003e span \u003e a\").TextContent()\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"could not get text content: %v\", err)\n\t\t}\n\t\tfmt.Printf(\"%d: %s\\n\", i+1, title)\n\t}\n\tif err = browser.Close(); err != nil {\n\t\tlog.Fatalf(\"could not close browser: %v\", err)\n\t}\n\tif err = pw.Stop(); err != nil {\n\t\tlog.Fatalf(\"could not stop Playwright: %v\", err)\n\t}\n}\n```\n\n## Docker\nRefer to the [Dockerfile.example](./Dockerfile.example) to build your own docker image.\n\n## More examples\n\n* Refer to [helper_test.go](./tests/helper_test.go) for End-To-End testing \n* [Downloading files](./examples/download/main.go)\n* [End-To-End testing a website](./examples/end-to-end-testing/main.go)\n* [Executing JavaScript in the browser](./examples/javascript/main.go)\n* [Emulate mobile and geolocation](./examples/mobile-and-geolocation/main.go)\n* [Parallel scraping using a WaitGroup](./examples/parallel-scraping/main.go)\n* [Rendering a PDF of a website](./examples/pdf/main.go)\n* [Scraping HackerNews](./examples/scraping/main.go)\n* [Take a screenshot](./examples/screenshot/main.go)\n* [Record a video](./examples/video/main.go)\n* [Monitor network activity](./examples/network-monitoring/main.go)\n\n## How does it work?\n\nPlaywright is a Node.js library which uses:\n\n* Chrome DevTools Protocol to communicate with Chromium\n* Patched Firefox to communicate with Firefox\n* Patched WebKit to communicate with WebKit\n\nThese patches are based on the original sources of the browsers and don't modify the browser behaviour so the browsers are basically the same (see [here](https://github.com/microsoft/playwright/tree/main/browser_patches)) as you see them in the wild. The support for different programming languages is based on exposing a RPC server in the Node.js land which can be used to allow other languages to use Playwright without implementing all the custom logic:\n\n* [Playwright for Python](https://github.com/microsoft/playwright-python)\n* [Playwright for .NET](https://github.com/microsoft/playwright-sharp)\n* [Playwright for Java](https://github.com/microsoft/playwright-java)\n* [Playwright for Go](https://github.com/playwright-community/playwright-go)\n\nThe bridge between Node.js and the other languages is basically a Node.js runtime combined with Playwright which gets shipped for each of these languages (around 50MB) and then communicates over stdio to send the relevant commands. This will also download the pre-compiled browsers.\n\n## Is Playwright for Go ready?\n\nWe are ready for your feedback, but we are still covering Playwright Go with the tests.\n\n## Resources\n\n* [Playwright for Go Documentation](https://pkg.go.dev/github.com/playwright-community/playwright-go)\n* [Playwright Documentation](https://playwright.dev/docs/api/class-playwright)\n* [Example recipes](https://github.com/playwright-community/playwright-go/tree/main/examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-community%2Fplaywright-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaywright-community%2Fplaywright-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaywright-community%2Fplaywright-go/lists"}