Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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?
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 EvanCarroll (Chaplain) on Nov 27, 2008 at 00:29 UTC
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.

    l8rZ,
    --
    andrew
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.

    --
    b10m

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-12-20 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls