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

4

8

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.

Renal answered 24/4, 2013 at 19:38 Comment(2)
Why would this question be down voted?Renal
Some users are "special" (like ralph). +1 for you.Pt
H
15

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

Hiett answered 4/2, 2014 at 13:7 Comment(0)
B
2

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

Buckley answered 29/5, 2013 at 12:9 Comment(0)
R
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!)

Renal answered 26/4, 2013 at 13:46 Comment(0)
F
0

you can embed perl script in node.js use:

npm install exec_perl

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

Forename answered 6/12, 2016 at 7:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.