I am trying to use get method in Scrappy module (version:0.94111280).It is working fine for some sites.But not for the others .It shows the error as follows:
Attribute (file) does not pass the type constraint because: Validation + failed fo r 'Str' with value undef at C:/Perl/site/lib/Scrappy/Session.pm line 7 +3 Scrappy::Session::write('Scrappy::Session=HASH(0x2d3dd94)') ca +lled at C: /Perl/site/lib/Scrappy/Session.pm line 90 Scrappy::Session::auto_write('Scrappy::Session=HASH(0x2d3dd94) +') called at C:/Perl/site/lib/Scrappy/Session.pm line 64 Scrappy::Session::stash('Scrappy::Session=HASH(0x2d3dd94)', 'c +ookies', ' HASH(0x31eaed4)') called at C:/Perl/site/lib/Scrappy/Scraper.pm line 3 +71 Scrappy::Scraper::__ANON__(0, 'ASPSESSIONIDSCSASSTD', 'PDMJJNF +CMCINKPNGC MGPNBIM', '/', 'www.alobebe.com.br', undef, 1, undef, undef, 1, 'HASH( +0x31ef47c) ') called at C:/Perl/site/lib/HTTP/Cookies.pm line 532 HTTP::Cookies::scan('HTTP::Cookies=HASH(0x2e8ba74)', 'CODE(0x3 +1182bc)') called at C:/Perl/site/lib/Scrappy/Scraper.pm line 391 Scrappy::Scraper::get('Scrappy=HASH(0x2e80c9c)', 'URI::URL=ARR +AY(0x2fd33 ec)') called at D:\sun\Scrappy\scrap_sam.pl line 10
MY CODE: use Scrappy; use URI::URL; my $scraper=Scrappy->new; $url1=URI::URL->new('http://www.alobebe.com.br'); my $var=$scraper->get($url1); $scraper->store('foo.html');

In reply to Get method in Scrappy module is not working for some sites by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.