Tag: node horseman

用节点骑士刮一批页面:一些例外情况没有抓住

我正在使用nodeman和horseman来search(已知是有效的)url列表,并依次对它们执行相同的scraping操作。 我试图捕捉错误,但有时候,一些exception仍然通过并挂起脚本。 我可以一次运行同一个urls'batch',并且再次发生错误。 到目前为止,我已经尝试过: – 捕捉错误; – 使用promiseRetry模块重试promise – 使用打开和closures每个刮擦操作的新马实例 // users: [ { href: '?id=abc123' }, … ] // queuePromise: function which returns a chain of promises from an array of functions with callbacks // promiseRetry: used to retry a promise :3, see promiseRetry documentation fetch = function(users, options){ var baseUrl = 'https://www.somedomain.com/Users' var […]