You are here: Home » NewsFeeds » Osmosis: Web scraper for Node.js

Osmosis: Web scraper for Node.js

HTML/XML parser and web scraper for NodeJS.


  • Fast: uses libxml C bindings
  • Lightweight: no dependencies like jQuery, cheerio, or jsdom
  • Clean: promise based interface- no more nested callbacks
  • Flexible: supports both CSS and XPath selectors
  • Predictable: same input, same output, same order
  • Detailed logging for every step
  • Precise and natural IO flow- no setTimeout or process.nextTick
  • Easy debugging with built-in stack size and memory usage reporting
  • Memory leak free

Example: scrape all craigslist listings

var osmosis = require('osmosis');

.find('h1 + div a')
.find('header + div + div li > a')
.find('p > a', '.totallink +')
    'title':        'section > h2',
    'description':  '#postingbody',
    'subcategory':  'div.breadbox > span[4]',
    'date':         'time@datetime',
    'latitude':     '#map@data-latitude',
    'longitude':    '#map@data-longitude',
    'images[]':     'img@src'
.data(function(listing) {
    // do something with listing data


npm install osmosis


For documentation and examples check out



Original article