Thursday, 11 May 2017

Get IMG SRC via webscrabbing through cheerio with node.js

Using an event-listener to GET this and cheerio to get the img src out of:

<div class="mainimage"> 

Current code:

var cheerio = require('cheerio'),
$ = cheerio.load(this.responseText);
console.log($('mainimage').attr('img'));

However it returns 'undefined'



via Joseph Fuller

No comments:

Post a Comment