I'm trying to scrape some code, to get a link, and some text from a paragraph. But for some reason my code dosen't work, i have tried alot, and every time, it just gives me undifined.
var request = require('request');
var cheerio = require('cheerio');
request('https://bitskins.com', function (error, response, html) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(html);
$('p', '.chat-box-content').each(function(i, element){
if($(this).attr('style') == 'height: 15px;'){
console.log($(this));
}
});
}
});
https://gyazo.com/b80465474a389657c44aeeb64888a006
I only wan it to return the second and the third line, so the link and the price, but do i have to do? I'm new and i lost.