{"id":14482,"date":"2026-02-02T00:53:10","date_gmt":"2026-02-02T00:53:10","guid":{"rendered":"https:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=14482"},"modified":"2026-02-02T03:43:45","modified_gmt":"2026-02-02T03:43:45","slug":"%e4%bd%9c%e6%a5%ad%e3%83%a1%e3%83%a2-20260202-cutycapt-%e3%82%92%e5%88%a9%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=14482","title":{"rendered":"(\u4f5c\u696d\u30e1\u30e2 20260202) cutycapt \u3092\u5229\u7528\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/02\/20260202a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/02\/20260202a.png\" alt=\"\" width=\"778\" height=\"43\" class=\"aligncenter size-full wp-image-14485\" srcset=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/02\/20260202a.png 778w, http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/02\/20260202a-300x17.png 300w, http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/wp-content\/uploads\/2026\/02\/20260202a-768x42.png 768w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/a><\/p>\n<p>e-Learning \u306e\u6559\u6750\u306e\u8a71\u3067\u3059\u3002\u6559\u6750\u306e\u30d5\u30a1\u30a4\u30eb\u306b\uff0c\u305d\u308c\u81ea\u8eab\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a\u3057\u305f\u3068\u304d\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u3092\u542b\u3081\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<a href=\"https:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=13207\">\u4ee5\u524d\u306b\u5229\u7528\u3057\u305f puppeteer \u3092<\/a>\u4f7f\u7528\u3057\u3088\u3046\u3068\u8003\u3048\u307e\u3057\u305f\u304c\uff0c\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3002SCORM \u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u51fa\u3057\u306e\u6642\u306b\uff0c\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u753b\u50cf\u3092\u6f5c\u308a\u3053\u307e\u305b\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u6559\u6750\u3092\u4f5c\u6210\u3059\u308b\u30c4\u30fc\u30eb\u306f WEB\u30a2\u30d7\u30ea\u306a\u306e\u3067\uff0c\u30b5\u30fc\u30d0\u30fc\u5074\u3067\uff08www-data\u3067\uff09puppeteer \u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u304c\uff0c\u3053\u308c\u304c\u4ee5\u524d\u306f\u4f55\u3068\u304b\u306a\u3063\u305f\u306e\u3067\u3059\u3051\u3069\uff0c\u4eca\u306e\u74b0\u5883(ubuntu24)\u3067\u306f\uff0c\u3046\u307e\u304f\u52d5\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f8b\u3048\u3070\uff0c\u4e0b\u8a18\u306e\u5185\u5bb9\u306e\u30b3\u30fc\u30c9\uff08html-to-jpeg.js\uff09\u3092\u66f8\u3044\u3066<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\">const puppeteer = require('\/usr\/local\/lib\/node_modules\/puppeteer');\r\n\r\nconst fs = require('fs');\r\nconst path = '\/var\/www\/.cache\/puppeteer';\r\n\r\n\/\/ Launch Puppeteer with a custom cache path\r\n\r\nasync function launchBrowser() {\r\n    \/\/ensureCacheDirectory();\r\n    const browser = await puppeteer.launch({\r\n        headless: true,\r\n        executablePath: '\/snap\/bin\/chromium',\r\n        userDataDir: path,\r\n        args: ['--no-sandbox', '--disable-setuid-sandbox'],\r\n    });\r\n    return browser;\r\n}\r\n\r\n(async () => {\r\n  const browser = await launchBrowser();\r\n  const page = await browser.newPage();\r\n  await page.goto('https:\/\/techblog.recruit.co.jp\/article-1119\/'); \/\/ \u3053\u3053\u306b\u5909\u63db\u3057\u305f\u3044HTML\u306eURL\u3092\u5165\u529b\r\n  \/\/ Set screen size.\r\n  await page.setViewport({width: 1920, height: 1200});\r\n\r\n  await page.screenshot({path: '.\/output.png', type: 'png'});\r\n  await browser.close();\r\n})();<\/code><\/pre>\n<p>\u4e0a\u8a18\u3092\uff0c\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\">sudo -u www-data node .\/html-to-jpeg.js<\/code><\/pre>\n<p>\u305d\u3046\u3059\u308b\u3068\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\">Error: Failed to launch the browser process:  Code: 1\r\n\r\nstderr:\r\n\/user.slice\/user-1000.slice\/user@1000.service\/app.slice\/app-org.gnome.Terminal.slice\/vte-spawn-0a7f94f1-c80e-4d78-bcd3-effd21224d11.scope is not a snap cgroup for tag snap.chromium.chromium\r\n<\/code><\/pre>\n<p>snap \u304c\u5c0e\u5165\u3055\u308c\u305f\u3053\u3068\u304c\u95a2\u4fc2\u3057\u3066\u3044\u308b\u306e\u304b\uff0ccgroup \u3068\u3044\u3046\u306e\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30b0\u30eb\u30fc\u30d7\u3068\u3044\u3046\u3053\u3068\u306e\u69d8\u3067\u3059\u304c\uff0c\u30d6\u30e9\u30a6\u30b6\u3092\u8d77\u52d5\u3059\u308b\u306e\u306b\u6a29\u9650\u304c\u8db3\u308a\u306a\u3044\u3068\u8a00\u3063\u3066\u3044\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002\u3053\u308c\u304c\u89e3\u6c7a\u3067\u304d\u306a\u3044\u3002snap \u7248\u3067\u306f\u306a\u3044google-chrome \u3082\u8a66\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\uff0c\u3084\u306f\u308a\u8d77\u52d5\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u753b\u9762\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u304c\u3067\u304d\u308c\u3070\u3088\u3044\u306e\u3067\uff0cpuppeteer \u3092\u3042\u304d\u3089\u3081\u3066\uff0c\u4ed6\u306e\u30c4\u30fc\u30eb\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u305d\u308c\u306f <a href=\"https:\/\/cutycapt.sourceforge.net\/\">cutycapt<\/a> \u3068\u3044\u3046\u3082\u306e\u306a\u306e\u3067\u3059\u304c\uff0cWebKit\u30a8\u30f3\u30b8\u30f3\u3092\u5229\u7528\u3057\u305f\u3082\u306e\u3060\u305d\u3046\u3067\u3059\u3002cutycapt \u3068 xvfb \u3092\u5c0e\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\">sudo apt-get install cutycapt\r\nsudo apt-get install xvfb<\/code><\/pre>\n<p>\u4ed6\u306b\uff0c\u65e5\u672c\u8a9e\u30d5\u30a9\u30f3\u30c8\u306a\u3069\u3082\u5fc5\u8981\u3060\u3068\u306e\u3053\u3068\u3067\u3059\u304c\uff0cubuntu desktop \u74b0\u5883\u306a\u306e\u3067\uff0c\u305d\u308c\u306f\u3059\u3067\u306b\u6709\u3063\u305f\u3088\u3046\u3067\u3059\u3002\u4e0a\u8a18\u3060\u3051\u3067\u52d5\u304d\u307e\u3057\u305f\u3002\u4f7f\u7528\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u3072\u3068\u3064\u306a\u304c\u308a\u306e\u547d\u4ee4\u3067\u3059\u3002<\/p>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\">xvfb-run --server-args=\"-screen 0, 1280x1024x24\" cutycapt --url=https:\/\/www.google.com --out=.\/tmp\/google.png --delay=3000<\/code><\/pre>\n<p>3 \u79d2\u5f85\u3064\u3068\u3044\u3046\u306e\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002\u4e0a\u8a18\u306f www-data \u3067\u5b9f\u884c\u53ef\u80fd\u3067\u3057\u305f\u3002\u3053\u306e\u30da\u30fc\u30b8\u306e\u5192\u982d\u306e\u753b\u50cf\u306f\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u8fd4\u4e8b\u3067\u3059\u3002\u6b21\u56de\u306e\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u6642\u306b\uff0c\u3053\u308c\u3089\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u306a\u3044\u3068\u3002<\/p>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<\/p>\n<ul>\n<li><a href=\"https:\/\/gihyo.jp\/admin\/serial\/01\/ubuntu-recipe\/0328\">\u300c\u9055\u3044\u304c\u308f\u304b\u308b\u4eba\u300d\u306b\u306a\u308d\u3046<\/a><\/li>\n<li><a href=\"https:\/\/techblog.raccoon.ne.jp\/archives\/39639054.html\">\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9\u3067Web\u30da\u30fc\u30b8\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u753b\u50cf\u3092\u4f5c\u6210\u3059\u308b<\/a><\/li>\n<\/ul>\n<pre><code style=\"color: midnightblue; font-size: 12px; white-space: pre-wrap;\"><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>e-Learning \u306e\u6559\u6750\u306e\u8a71\u3067\u3059\u3002\u6559\u6750\u306e\u30d5\u30a1\u30a4\u30eb\u306b\uff0c\u305d\u308c\u81ea\u8eab\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u8868\u793a &#8230; <a class=\"more-link\" href=\"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/?p=14482\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-14482","post","type-post","status-publish","format-standard","hentry","category-column"],"_links":{"self":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/14482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14482"}],"version-history":[{"count":29,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/14482\/revisions"}],"predecessor-version":[{"id":14512,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/14482\/revisions\/14512"}],"wp:attachment":[{"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14482"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zairyo.susi.oita-u.ac.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}