in reply to How to make WWW::Mechanize honor robots.txt (possibly via LWP::RobotUA)

WWW::Mechanize is wrong to inherit from LWP::UserAgent. It should encapsulate it. That means you need to resort to the following hack:

use LWP::RobotUA qw( ); use WWW::Mechanize qw( ); BEGIN { package WWW::Mechanize; our @ISA; @ISA = ( 'LWP::RobotUA', ( grep $_ ne 'LWP::UserAgent' && $_ ne 'LWP::RobotUA', @ISA ), ); }

Note that this will affect all WWW::Mechanize objects in your process.

  • Comment on Re: How to make WWW::Mechanize honor robots.txt (possibly via LWP::RobotUA)
  • Download Code