6jzryg
Last Updated: February 25, 2016
·
426
· wookiecooking

Scrape Hacker News with Node.JS

jsdom = require("jsdom")
jsdom.env
  url: "http://news.ycombinator.com/"
  scripts: ["http://code.jquery.com/jquery.js"]
  done: (errors, window) ->
    $ = window.$
    $("td.title:not(:last) a").each ->
      console.log $(this).text(), "\n", $(this).attr("href")