New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

walkers

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walkers

Recursive DOM traversal using htmlparser2.

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Recursive DOM traversal using htmlparser2.

Getting Started

Install the module with: npm install walkers

var walkers = require('../lib/walkers.js');
var request = require('request');
var htmlparser = require("htmlparser2");

request('http://example.com', function (error, response, body) {
  if (!error && response.statusCode == 200) {
    var handler = new htmlparser.DomHandler(function (error, dom) {
      if (error) console.log(err)
      else {

        walkers.walk(dom, true, function(node){
          //Do something with leaf node
        }, function(){
          //Do something when finished walking
        })

      }
    });
    var parser = new htmlparser.Parser(handler);
    parser.write(body);
    parser.done();
  }
})

License

Copyright (c) 2015 Sterling Jordan Calder
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 27 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc