{"id":13433670,"url":"https://github.com/ebidel/try-puppeteer","last_synced_at":"2025-04-12T23:32:56.569Z","repository":{"id":37677915,"uuid":"102788385","full_name":"ebidel/try-puppeteer","owner":"ebidel","description":"Run Puppeteer code in the cloud","archived":false,"fork":false,"pushed_at":"2024-02-28T17:40:00.000Z","size":146,"stargazers_count":736,"open_issues_count":26,"forks_count":119,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-04T02:09:48.474Z","etag":null,"topics":["appengine","docker","headless-chrome","node","puppeteer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebidel.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":"2017-09-07T21:42:34.000Z","updated_at":"2025-03-28T00:04:09.000Z","dependencies_parsed_at":"2024-09-14T00:22:24.878Z","dependency_job_id":null,"html_url":"https://github.com/ebidel/try-puppeteer","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":"0.051724137931034475","last_synced_commit":"a2ceef12243c0a406ebf26702fe3b1711eb2ddb4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebidel%2Ftry-puppeteer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebidel%2Ftry-puppeteer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebidel%2Ftry-puppeteer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebidel%2Ftry-puppeteer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebidel","download_url":"https://codeload.github.com/ebidel/try-puppeteer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"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":["appengine","docker","headless-chrome","node","puppeteer"],"created_at":"2024-07-31T02:01:32.551Z","updated_at":"2025-04-12T23:32:56.547Z","avatar_url":"https://github.com/ebidel.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","JavaScript (71)"],"sub_categories":[],"readme":"## Try Puppeteer!\n\n\u003e Run [Puppeteer](https://github.com/GoogleChrome/puppeteer) scripts in the cloud.\n\n## Develop\n\nInstallation:\n\n```sh\nyarn; yarn install-backend\n# or npm i\n```\n\n### Backend\n\nThe backend is a Docker container which installs the latest Chrome package\nthat works with Puppeteer on Linux.\n\n\u003e **Note**: You'll need to have Docker running before attempting each step in this section.\n\n#### Building it\n\n```sh\nyarn build\n```\n\n#### Running the container\n\nThe container can be run in two modes: standalone as an executable, or as a web service.\n\n**1. Using the standalone CLI**\n\nThe first is a \"standalone\" mode that runs a Puppeteer script from the CLI. It takes a script file as an argument and runs it in the container.\n\n```\n./backend/run_puppeteer.sh your-puppeteer-script.js\n```\n\n**2. Running the web service**\n\nThe second option is running the container as a web server. The endpoint accepts\nfile uploads for running your Puppeteer scripts in the cloud:\n\nStart the server:\n\n```sh\ncd backend\nyarn serve\n# yarn restart is handy too. It rebuilds the container and starts the server.\n```\n\n**Example** - running a Puppeteer script\n\n```js\nasync function runCode(code) {\n  const form = new FormData();\n  form.append('file', new Blob([code], {type: 'text/javascript'}));\n  const resp = await fetch('http://localhost:8080/run', {method: 'POST', body: form});\n  return await resp.json();\n}\n\nconst code = `\n  const browser = await puppeteer.launch();\n  const page = await browser.newPage();\n  await page.goto('https://example.com');\n  console.log(await page.content());\n  browser.close();\n`;\n\nrunCode(code).then(result =\u003e {\n  if (result.errors) {\n    console.error(result.errors);\n  }\n  console.log(result.log);\n});\n```\n\n**Notes**:\n\n- There's no need to `require('puppeteer')`. This is done for you on the backend.\n- Top-level async/await are supported.\n\n### Code editor frontend\n\nFire up the code editor UI from the main directory:\n\n```\nyarn serve\n```\n\nThen navigate to `http://localhost:8081`.\n\n\n## Deployment\n\n1. Update the version of Puppeteer used in index.html, include the doc link. TODO: make this automatic.\n\n2. `yarn deploy` deploys both the frontend and backend services to App Engine Flex. The\napps can also be deployed individually:\n\n```sh\nyarn deploy-frontend\nyarn deploy-backend\n```\n\n## Notes \u0026 Limitations\n\n- By default, Puppeteer launches and uses its own bundled version of Chromium. To use\n  the [`google-chrome-unstable`](https://www.ubuntuupdates.org/ppa/google_chrome) installed by the container, pass `executablePath`:\n\n  ```js\n  const browser = await puppeteer.launch({\n    executablePath: 'google-chrome-unstable'\n  });\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febidel%2Ftry-puppeteer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febidel%2Ftry-puppeteer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febidel%2Ftry-puppeteer/lists"}