Hi, I don't know what your code is all about: you mention Mech but the code does not show it. I also don't know about your 500 error: that might be LWP not supporting 405 which is the code the site returns.

In any case, that page requires JavaScript to be enabled. WWW::Mechanize does not support JavaScript. Perhaps you can get around it by filling the CAPTCHA returned?

Using something more modern and simple to see what's going on:

use strict; use warnings; use feature 'say'; use Path::Tiny; use HTTP::Tiny; use HTTP::CookieJar; my $jar_file = Path::Tiny->tempfile; $jar_file->touch; my $jar = HTTP::CookieJar->new->load_cookies( $jar_file->lines ); my $ua = HTTP::Tiny->new( cookie_jar => $jar ); my $url = 'https://camelcamelcamel.com'; my $res = $ua->get( $url ); say $res->{'status'}; say $res->{'content'}; __END__
Output:
405 [ snip ] <p> As you were browsing <strong>camelcamelcamel.com</ +strong> something about your browser made us think you were a bot. Th +ere are a few reasons this might happen: </p> <ul> <li>You're a power user moving through this websit +e with super-human speed.</li> <li>You've disabled JavaScript in your web browser +.</li> <li>A third-party browser plugin, such as Ghostery + or NoScript, is preventing JavaScript from running. Additional infor +mation is available in this <a title='Third party browser plugins tha +t block javascript' href='http://ds.tl/help-third-party-plugins' targ +et='_blank'>support article</a>.</li> </ul> <p>After completing the CAPTCHA below, you will immedi +ately regain access to camelcamelcamel.com.</p> [ snip ]

Hope this helps!


The way forward always starts with a minimal test.

In reply to Re: Can't able to get source page 500 error. by 1nickt
in thread Can't able to get source page 500 error. by sugu

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.