CentOS7にて以下の内容のtest.jsをpuppeteerで実行したいのですが、
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
headless: false, // 動作確認するためheadlessモードにしない
slowMo: 500 // 動作確認しやすいようにpuppeteerの操作を遅延させる
})
const page = await browser.newPage()
await page.goto('https://www.google.com/')
await page.type('input[name=q]', 'スカイツリー', { delay: 100 })
await page.click('input[type="submit"]')
await page.waitForSelector('h3 a')
await page.screenshot({ path: 'screenshot/sample1.png' })
await browser.close()
}
https://www.google.com/ にアクセスして、 スカイツリー の検索結果のスクリーンショットをとり、 screenshotディレクトリ に保存
実行しましたが、
コマンドプロンプトに
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/home/test/node_modules/puppeteer/lib/Launcher.js:342:14) at Interface.helper.addEventListener (/home/test/node_modules/puppeteer/lib/Launcher.js:331:50) at emitNone (events.js:111:20) at Interface.emit (events.js:208:7) at Interface.close (readline.js:368:8) at Socket.onend (readline.js:147:10) at emitNone (events.js:111:20) at Socket.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:139:11)
(node:4453) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4453) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
とでて実行できません。どなたかご教示願います。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。