LoginSignup
1

More than 5 years have passed since last update.

node-webshotでベーシック認証サイトのキャプチャを取得する

Posted at

下記ドキュメントを見れば一目瞭然ですが、customHeaderがoptionで指定できるようになっています。
https://github.com/brenden/node-webshot#options

const options = {
  screenSize: {
    width: 720,
    height: 360
  },
  shotSize: {
    width: 720,
    height: "all"
  },
 customHeaders: {
    Authorization: "Basic base64encodedstring"
 }
};

webshot(url, outputFile, options, (err) => {
  // 省略
}

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
What you can do with signing up
1