Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: What Tools Do You Use With WWW::Mechanize

by Limbic~Region (Chancellor)
on Dec 03, 2011 at 20:03 UTC ( #941565=note: print w/ replies, xml ) Need Help??


in reply to Re: What Tools Do You Use With WWW::Mechanize
in thread What Tools Do You Use With WWW::Mechanize

cavac,
It took me a while to reproduce your problem but I finally encountered a situation where WWW::Mechanize behaves differently than WWW::Mechanize::GZip.

$mech->mirror($url => $file);
With WWW::Mechanize::GZip, the file is properly decoded - not so with WWW::Mechanize. This doesn't mean that WWW::Mechanize doesn't handle compression - this alternative form worked just fine with the same file and WWW::Mechanize:
$mech->get($url, ':content_file' => $file);

Cheers - L~R


Comment on Re^2: What Tools Do You Use With WWW::Mechanize
Select or Download Code
Re^3: What Tools Do You Use With WWW::Mechanize
by cavac (Chaplain) on Dec 07, 2011 at 15:24 UTC

    I encountered the problem while implementing content compression in Maplat. It happened while while handling forms and downloading dynamically created XML files.

    The client was running on Windows with ActivePerl. There *may* have been i misconfiguration or missing package. But i have since reinstalled the windows development server, so i'll have to recreate the circumstances and try if i can come up with a small test system.

    It may have been a bug in Maplat as well. But then again it only happened with WWW::Mechanize.

    Do you have Compress::Zlib installed? That is - from what i can tell with only a glance at the source - the main difference between WWW::Mechanize and WWW::Mechanize::GZip. The former uses Compress::Zlib when available while the later requires it to be installed.

    That said, i'll try to recreate the problem but it might take some time. I'm currently in the middle of preparing a big server upgrade (nice monks are allowed to upgrade to Postgres 9.x while naughty ones have to keep using flat files).

    Don't use '#ff0000':
    use Acme::AutoColor; my $redcolor = RED();
    All colors subject to change without notice.
      cavac,
      Do you have Compress::Zlib installed?

      All versions of ActiveState Perl in recent memory come with both Compress::Zlib and WWW::Mechanize. I develop in a lot of environments under a lot of versions of perl so I can't say what the behavior would be like elsewhere. When I am writing scraping software, it is usually for a client which usually means windows so I had never encountered it before that post.

      Cheers - L~R

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-30 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls