Search code examples
javascriptnode.jswww-mechanizewww-mechanize-firefox

Is there a Node.js equivalent of Perl's WWW::Mechanize?


I'm searching a module for Node which would be similar to WWW::Mechanize for Perl. Or even better to WWW::Mechanize::Firefox.

  • The main functionality would be to find and submit form by name, class or id.
  • The ability to handle cookies would be great
  • and the ability to handle Javascript would be perfect.

If anyone had an idea of something similar, or in which direction I could search, that would really be appreciated.


Solution

  • What you're looking for is a scriptable/headless browser. In decreasing order of popularity, the options are:

    • Google Puppeteer - "Node library which provides a high-level API to control Chrome or Chromium"
    • Zombie - more lightweight; "Insanely fast, headless full-stack testing using Node.js"
    • slimerjs - scriptable Firefox. No commits since March 2018.
    • mechanize-js, which lacks documentation and has far less traction than any of the above alternatives

    Abandoned projects