Advertisement
Guest User

Will Work

a guest
Oct 23rd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var request = require('request');
  2. var cheerio = require('cheerio');
  3. request('http://www.nasdaq.com/symbol/spy/time-sales', function (error, response, body) {
  4.   if (!error && response.statusCode == 200) {
  5.     var $ = cheerio.load(body);
  6.     var res = [];
  7.     console.log($("#AfterHoursPagingContents_Table").children()[1])
  8.     $($("#AfterHoursPagingContents_Table").children()[1]).children().each(function(i,child){
  9.         console.log(child)
  10.         var data =  [$(child.children[0]).text(),$(child.children[1]).text(),$(child.children[2]).text()];
  11.         res.push(data.join(", "))
  12.     })
  13.     console.log(res.join("\n"));
  14.   }
  15. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement