node.io

  • 所有者: node-js-libs/node.io
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Note: this library is no longer maintained.

I wrote node.io in 2010 when node.js was still in its infancy and the npm repository didn't have the amazing choice of libraries as it does today.

Since it's now quite trivial to write your own scraper I've decided to stop maintaining the library.

Here's an example using request, cheerio and async.

var request = require('request')
  , cheerio = require('cheerio')
  , async = require('async')
  , format = require('util').format;

var reddits = [ 'programming', 'javascript', 'node' ]
  , concurrency = 2;

async.eachLimit(reddits, concurrency, function (reddit, next) {
    var url = format('http://reddit.com/r/%s', reddit);
    request(url, function (err, response, body) {
        if (err) throw err;
        var $ = cheerio.load(body);
        $('a.title').each(function () {
            console.log('%s (%s)', $(this).text(), $(this).attr('href'));
        });
        next();
    });
});

Happy scraping.

主要指標

概覽
名稱與所有者node-js-libs/node.io
主編程語言JavaScript
編程語言Perl (語言數: 4)
平台
許可證MIT License
所有者活动
創建於2010-11-03 08:53:10
推送於2015-11-18 03:22:35
最后一次提交2014-12-04 08:52:10
發布數4
最新版本名稱0.5.1 (發布於 )
第一版名稱0.4.13 (發布於 )
用户参与
星數1.8k
關注者數50
派生數140
提交數436
已啟用問題?
問題數138
打開的問題數0
拉請求數18
打開的拉請求數0
關閉的拉請求數9
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?