screen scraping - Cannot seem to scrape a div class tag in Node.js -
i'm new node.js. experience has been in java , vba. i'm trying scrape website friend , going until can't i’m after.
<div class="gwt-label adc2x2-c-q adc2x2-b-nb adc2x2-b-zb">phone: +4576 102900</div>
that tag has text. no attr or anything. yet cannot scrape using cheerio.
if(!err && resp.statuscode == 200){ var $ = cheerio.load(body); var number = $('//tried here!').text(); console.log(number);
this function played around
$('.adc2x2').filter(function(i){ console.log("sdfs"); console.log (i);
any suggestions appreciated.
thanks all!
i take answer cheerio documentation.
$(".gwt-label").text();
if that's not working, maybe have many frame in page. possibility page renderer @ client side, angular pages, element search not in server html, created after page load. if that's true, use full browser phantomjs , not dom traverser tool cheerio.
Comments
Post a Comment