var Nightmare = require('nightmare'); var nm = Nightmare({ show: false, 'web-preferences': {'web-security': false} }); var nightmare = function(io) { return nm .goto('https://www.nytimes.com/') .evaluate(function () { var links = document.querySelectorAll('a'); var hrefs = []; for (var i=0; i