0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分の記事の中でも古い情報になったもの

Posted at

Node.jsでwkhtmltoimageを使ってWebサイトのキャプチャ画像を取得
Node.jsでWebサイトのスクリーンショットを保存 その2

今どきはHeadless ChromeとPuppeteerでいけますね

puppeteer.js
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png'});

  await browser.close();
})();

async/awaitも使えばこんなに簡単
というわけでPromise関連のインターフェースが用意されてないモジュールを使わない限りはこれもObsoleteでしょう

コールバック地獄とasync.js

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?