7

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.

Sami
  • 614
  • 7
  • 19

4 Answers4

13

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

Dan Dascalescu
  • 110,650
  • 40
  • 276
  • 363
1

Try mechanize-js - the name says it all...

Erel Segal-Halevi
  • 26,318
  • 26
  • 92
  • 153
0

The closest tool I have found for now is zombie.

Apparently it is not exactly ready for production (and may never be) as it is a testing tool. Nevertheless it seems that it is the closest match for the functionality needed (and it supports JS!)

Sami
  • 614
  • 7
  • 19
0

you can embed perl script in node.js use:

npm install exec_perl

see: https://github.com/tlqtangok/exec_perl

tlqtangok
  • 65
  • 1
  • 5