#14 共通のサムネとタイトルの取得は完成
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const puppeteer = require ('puppeteer')
|
||||
const fs = require ('fs')
|
||||
|
||||
|
||||
void (async () => {
|
||||
const url = process.argv[2]
|
||||
const output = process.argv[3]
|
||||
|
||||
const browser = await puppeteer.launch ({
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox'] })
|
||||
|
||||
const page = await browser.newPage ()
|
||||
await page.setViewport ({ width: 960, height: 960 })
|
||||
await page.goto (url, { waitUntil: 'networkidle2', timeout: 10000 })
|
||||
|
||||
await page.screenshot ({ path: output })
|
||||
await browser.close ()
|
||||
}) ()
|
||||
Reference in New Issue
Block a user