{"id":13725523,"url":"https://github.com/PaulKinlan/puppeteer-go","last_synced_at":"2025-05-07T20:32:38.962Z","repository":{"id":37752299,"uuid":"224830333","full_name":"PaulKinlan/puppeteer-go","owner":"PaulKinlan","description":"Simple utility to help quickly script puppeteer programs","archived":false,"fork":false,"pushed_at":"2022-07-21T19:32:54.000Z","size":23,"stargazers_count":88,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-08T04:38:54.507Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://paul.kinlan.me/puppeteer-go/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaulKinlan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-29T10:19:09.000Z","updated_at":"2024-09-08T15:21:24.000Z","dependencies_parsed_at":"2022-08-08T21:31:02.750Z","dependency_job_id":null,"html_url":"https://github.com/PaulKinlan/puppeteer-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulKinlan%2Fpuppeteer-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulKinlan%2Fpuppeteer-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulKinlan%2Fpuppeteer-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulKinlan%2Fpuppeteer-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulKinlan","download_url":"https://codeload.github.com/PaulKinlan/puppeteer-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224632830,"owners_count":17343921,"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":[],"created_at":"2024-08-03T01:02:25.983Z","updated_at":"2024-11-14T15:31:23.438Z","avatar_url":"https://github.com/PaulKinlan.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Puppeteer Go\n============\n\nJust a simple API to script puppeteer, all it does is load a URL and then let you run a function against the page once it has loaded. \n\nThat is all.\n\nUsage\n-----\n\n1. Install\n\n`npm i puppeteer-go`\n\n2. Include\n\n`const {go} = require('puppeteer-go');`\n\n3. Use\n\n``` JavaScript\n/*\n page - the Page instance returned from puppeteer\n browser - the Browser instance returned from puppeteer\n\n*/\nconst callback = (page, browser) { ... };\n\ngo(url, callback)\n\n\n```\nWhy does this exist?\n--------------------\n\nI like building little scripts to automate actions on the web with puppeteer but I kept forgetting the stanza to start a session, browser to a page ... that and my fingers kept getting tired.\n\nExamples\n--------\n\n1. Screen shotting elements on a page\n\n```JavaScript\nconst {go} = require('puppeteer-go');\n\ngo('https://paul.kinlan.me', async (page) =\u003e {\n    const elements = await page.$$(\"h1\");\n    let count = 0;\n    for(let element of elements) {\n      try {\n        await element.screenshot({ path: `${count++}.png`});\n      } catch (err) {\n        console.log(count, err);\n      }\n    }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaulKinlan%2Fpuppeteer-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPaulKinlan%2Fpuppeteer-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaulKinlan%2Fpuppeteer-go/lists"}