Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

LWP or Mechanize?

by kayj (Novice)
on Nov 26, 2008 at 22:36 UTC ( #726248=perlquestion: print w/ replies, xml ) Need Help??
kayj has asked for the wisdom of the Perl Monks concerning the following question:

Is it better to use LWP or Mechanize package to download data from a web site?

Comment on LWP or Mechanize?
Replies are listed 'Best First'.
Re: LWP or Mechanize?
by Anonymous Monk on Nov 26, 2008 at 23:47 UTC
    WWW::Mechanize is a subclass of LWP, and its easier to use.
Re: LWP or Mechanize?
by afresh1 (Hermit) on Nov 27, 2008 at 03:46 UTC

    Really it depends on what you are trying to do. If you are getting a list of previously known urls (or a single resource), then LWP is probably better. However, if you are going to be browsing a site, looking at different pages to find things, filling out forms to get information or other more complicated things, then WWW::Mechanize is probably a better choice. Really, whichever makes it easier to accomplish what you are trying to do is probably the best choice.

Re: LWP or Mechanize?
by EvanCarroll (Chaplain) on Nov 27, 2008 at 00:29 UTC
Re: LWP or Mechanize?
by b10m (Vicar) on Dec 02, 2008 at 10:05 UTC

    As others have said, it really depends on what you're trying to do. If you'd like to download but a file, I'd go for LWP::Simple. If you were going to get into scraping, I'd highly recommend Web::Scraper, but if you want to navigate a site, click a few links and submit a form or two, yes, go for WWW::Mechanize.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://726248]
Approved by ww
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2015-11-26 04:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls