Skip to content

Instantly share code, notes, and snippets.

@DanPurdy
Last active September 14, 2017 14:49
Show Gist options
  • Save DanPurdy/8a123dc1fe839b5d358ce6d19f3789e2 to your computer and use it in GitHub Desktop.
Save DanPurdy/8a123dc1fe839b5d358ce6d19f3789e2 to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
const cheerio = require('cheerio');
const request = require('request');
app.get('/', (req, res, next) => {
const url = 'URL HERE';
request(url, (err, resp, body) => {
const $ = cheerio.load(body);
$('.CLASS_HERE').each(function() {
console.log($(this).text().trim().replace(/\s\s+/g, ''));
});
});
res.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment