Skip to content

Instantly share code, notes, and snippets.

@stuartf
Created September 29, 2016 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartf/2ffc5fae039189253233b1876f49b0dd to your computer and use it in GitHub Desktop.
Save stuartf/2ffc5fae039189253233b1876f49b0dd to your computer and use it in GitHub Desktop.
Get everything from <pre> tags in an html file
var cheerio = require('cheerio');
var fs = require('fs');
fs.readFile(process.argv[2], function(err, html) {
var $ = cheerio.load(html);
console.log($('pre').html());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment