{"id":1482,"date":"2021-06-24T08:23:01","date_gmt":"2021-06-23T23:23:01","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=1482"},"modified":"2021-06-24T08:23:03","modified_gmt":"2021-06-23T23:23:03","slug":"post-1482","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/06\/24\/1482\/","title":{"rendered":"puppeteer \u3067\u30d5\u30eb\u30da\u30fc\u30b8\u306e\u753b\u50cf\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"\n<p>\u3000puppeteer \u3067\u30da\u30fc\u30b8\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u969b\u306b\u3001fullPage \u30aa\u30d7\u30b7\u30e7\u30f3\u3092 true \u306b\u3059\u308b\u3068\u3001\u30da\u30fc\u30b8\u5168\u4f53\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u304c\u64ae\u308c\u308b\u306f\u305a\u3067\u3059\u304c\u3001Raspberry Pi \u3067\u306f\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306b\u8a2d\u5b9a\u3057\u305f\u7bc4\u56f2\u3057\u304b\u63cf\u753b\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3000\u3061\u3087\u3063\u3068\u5de5\u592b\u3092\u3057\u3066\u30da\u30fc\u30b8\u5168\u4f53\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u624b\u9806\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"font-size: 17px\" class=\"font-size\">\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a\u3067\u9ad8\u3055\u3092\u5927\u304d\u306a\u5024\u306b\u3059\u308b\u3002<\/span><\/li><li><span style=\"font-size: 17px\" class=\"font-size\">\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067 body \u30b5\u30a4\u30ba\u306b\u30af\u30ea\u30c3\u30d7\u3059\u308b\u3002<\/span><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n\n\n\n<p>\u3000\u307e\u305a\u3001\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306e\u5e45\u3092\u6c7a\u3081\u307e\u3059\u3002\u3053\u306e\u5e45\u306f\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u3068\u304d\u306e\u5e45\u3068\u540c\u3058\u306b\u3059\u308b\u306e\u3067\u3001\u5b9a\u6570\u306b\u3057\u307e\u3059\u3002\u3064\u3044\u3067\u306b\u9ad8\u3055\u3082\u5b9a\u6570\u306b\u3057\u307e\u3059\u3002\u9ad8\u3055\u306f\u3001\u30da\u30fc\u30b8\u306e\u9ad8\u3055\u3088\u308a\u3082\u5341\u5206\u5927\u304d\u306a\u30b5\u30a4\u30ba\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted file\">const viewWidth = 1024;<br>const viewHeight = 99999;<\/pre>\n\n\n\n<p>\u3000\u3053\u306e\u5b9a\u6570\u3092\u4f7f\u3044\u3001\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted file\">await page.setViewport({<br>  width: viewWidth,<br>  height: viewHeight<br>});<\/pre>\n\n\n\n<p>\u3000\u5f8c\u306f\u3001\u30da\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3081\u3070\u3044\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b<\/h2>\n\n\n\n<p>\u3000\u3053\u306e\u307e\u307e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u3068\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306e\u30b5\u30a4\u30ba\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30af\u30ea\u30c3\u30d7\u3057\u307e\u3059\u3002\u30af\u30ea\u30c3\u30d7\u3059\u308b\u969b\u3001\u9ad8\u3055\u3092 body \u306e\u9ad8\u3055\u306b\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u304d\u3063\u3061\u308a\u306e\u30b5\u30a4\u30ba\u3060\u3068\u3001\u6700\u4e0b\u7aef\u304c\u30ae\u30ea\u30ae\u30ea\u306a\u306e\u3067\u3001\u4f59\u88d5\u3092\u6301\u305f\u305b\u308b\u305f\u3081\u3001\u9ad8\u3055\u3092 32 pixel \u5897\u3084\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted file\">await page.screenshot({\n  path: \"screenshot.png\",\n  clip: {\n    x: 0,\n    y: 0,\n    width: viewWidth,\n    height: await page.evaluate(() => document.body.clientHeight) + 32\n  }\n});<\/pre>\n\n\n\n<p>\u3000\u3053\u308c\u3067\u30da\u30fc\u30b8\u5168\u4f53\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u304c\u64ae\u308c\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000puppeteer \u3067\u30da\u30fc\u30b8\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u969b\u306b\u3001fullPage \u30aa\u30d7\u30b7\u30e7\u30f3\u3092 true \u306b\u3059\u308b\u3068\u3001\u30da\u30fc\u30b8\u5168\u4f53\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u304c\u64ae\u308c\u308b\u306f\u305a\u3067\u3059\u304c\u3001Raspberry Pi \u3067\u306f\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u306b\u8a2d\u5b9a\u3057\u305f\u7bc4\u56f2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,4],"tags":[],"class_list":["post-1482","post","type-post","status-publish","format-standard","hentry","category-pupeeteer","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=1482"}],"version-history":[{"count":4,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1482\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/1482\/revisions\/1537"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=1482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=1482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=1482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}