Skip to content

Instantly share code, notes, and snippets.

Created Sep 7, 2018
What would you like to do?
mozilla/readability を使った本文抽出サンプル
import puppeteer from 'puppeteer'
const Readability = require("readability");
import { JSDOM } from 'jsdom'
const URL = 'url'
(async () => {
const browser = await puppeteer.launch({
args: [
const page = await browser.newPage();
await page.goto(url);
const html = await page.evaluate(() => {
return document.body.innerHTML
const dom = new JSDOM(html)
const content = new Readability(dom.window.document).parse()
await browser.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment