{"id":13517063,"url":"https://github.com/cheeaun/puppetron","last_synced_at":"2025-04-05T12:06:21.929Z","repository":{"id":41165455,"uuid":"101042050","full_name":"cheeaun/puppetron","owner":"cheeaun","description":"Puppeteer (Headless Chrome Node API)-based rendering solution.","archived":false,"fork":false,"pushed_at":"2022-06-17T01:45:48.000Z","size":186,"stargazers_count":535,"open_issues_count":8,"forks_count":94,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-29T11:08:28.667Z","etag":null,"topics":["chrome","chromium","headless","pdf","prerender","puppeteer","screenshot"],"latest_commit_sha":null,"homepage":"https://puppetron.now.sh/","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/cheeaun.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":"2017-08-22T08:48:50.000Z","updated_at":"2025-03-18T04:57:49.000Z","dependencies_parsed_at":"2022-07-16T18:16:57.569Z","dependency_job_id":null,"html_url":"https://github.com/cheeaun/puppetron","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/cheeaun%2Fpuppetron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fpuppetron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fpuppetron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheeaun%2Fpuppetron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheeaun","download_url":"https://codeload.github.com/cheeaun/puppetron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332604,"owners_count":20921853,"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":["chrome","chromium","headless","pdf","prerender","puppeteer","screenshot"],"created_at":"2024-08-01T05:01:29.218Z","updated_at":"2025-04-05T12:06:21.903Z","avatar_url":"https://github.com/cheeaun.png","language":"JavaScript","readme":"# \u003cimg src=\"assets/logo.png\" width=\"400\" alt=\"Puppetron\"\u003e\n\n\u003e [Puppeteer](https://github.com/puppeteer/puppeteer) (Headless Chrome Node API)-based rendering solution.\n\nVideos \u0026 Tweets:\n\n- Demo \u003chttps://www.youtube.com/watch?v=n4sRp3qe_1Y\u003e\n- `clipSelector` demo \u003chttps://www.youtube.com/watch?v=wYCrJu-Wy2E\u003e\n- CJK fonts support \u003chttps://twitter.com/cheeaun/status/902340897433501696\u003e\n- Emoji support \u003chttps://twitter.com/cheeaun/status/903492052452728832\u003e\n\n**⚠️⚠️⚠️ NOTE:** Starting version 2.0, CJK and emoji support is gone.\n\n## 🚧🚧🚧 PLEASE READ THIS 🚧🚧🚧\n\n**Do NOT use this for production use-cases.**\n\nThis is just a demo site of what cool things that `Puppeteer` can do. Under any circumstances, this site may be down any time or be heavily rate-limited to prevent abuse.\n\nPlease check out what [Puppeteer](https://github.com/GoogleChrome/puppeteer) can do for your own use case and host on your own servers.\n\n## API\n\nThe API can perform 3 actions:\n\n- [Screenshot](#screenshot) - take a screenshot of the web page\n- [Render](#render) - render and serialize a HTML copy of the web page\n- [PDF](#pdf) - generate a PDF of the web page\n\n**`URL`** - the URL with encoded `pathname`, `search` and `hash`.\n\nGlobal parameters:\n\n- `width` - width of viewport/screenshot (default: `1024`)\n- `height` - height of viewport/screenshot (default: `768`)\n\n### Screenshot\n\n```\n/screenshot/{URL}\n...or\n/{URL}\n```\n\nParameters:\n\n- `thumbWidth` - width of thumbnail, respecting aspect ratio (no default, has to be smaller than `width`)\n- `fullPage` - takes a screenshot of the full scrollable page (default: `false`). If the page is too long, it may time out.\n- `clipSelector` - CSS selector of element to be clipped (no default). E.g.: `.weather-forecast`.\n\n### Render\n\n```\n/render/{URL}\n```\n\nNotes:\n\n- `script` tags except `JSON-LD` will be removed\n- `link[rel=import]` tags will be removed\n- HTML comments will be removed\n- `base` tag will be added for loading relative resources\n- Elements with absolute paths like `src=\"/xxx\"` or `href=\"/xxx\"` will be prepended with the origin URL.\n\nParameters: _None_\n\n### PDF\n\n```\n/pdf/{URL}\n```\n\nParameters:\n\n- `format`: Paper format that [Puppeteer supports](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions). E.g.: `Letter`, `Legal`, `A4`, etc. (default: `Letter`)\n- `pageRanges`: Paper ranges to print. E.g., `1-5`, `8`, `11-13` (default all pages)\n\n## Development\n\n### Requirements\n\n- [Node.js](https://nodejs.org/en/)\n- [Vercel](https://vercel.com/download)\n\n#### Steps\n\n1. `npm i`\n2. `npm start`\n3. Load `localhost:3000`\n\n## Credits\n\nBlock list from [Prerender](https://github.com/prerender/prerender/blob/master/lib/resources/blocked-resources.json).\n\nFor version 1.0, this uses [`cheeaun/puppeteer`](https://hub.docker.com/r/cheeaun/puppeteer/) Docker image.\n\nFor version 2.0, this uses some parts from [Zeit's now-examples: misc-screenshot](https://github.com/zeit/now-examples/blob/master/misc-screenshot/Dockerfile).\n\nInspired by [`zenato/puppeteer`](\u003c(https://hub.docker.com/r/zenato/puppeteer/)\u003e), [`puppeteer-renderer`](https://github.com/zenato/puppeteer-renderer) and [Rendertron](https://render-tron.appspot.com/).\n","funding_links":[],"categories":["JavaScript","渲染和网页抓取","Rendering and web scraping"],"sub_categories":["贡献"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeaun%2Fpuppetron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheeaun%2Fpuppetron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeaun%2Fpuppetron/lists"}