Last active
September 14, 2017 14:49
-
-
Save DanPurdy/8a123dc1fe839b5d358ce6d19f3789e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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