in reply to Can't able to get source page 500 error.
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:
Output: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__
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't able to get source page 500 error.
by sugu (Initiate) on Jun 08, 2017 at 13:38 UTC | |
by 1nickt (Canon) on Jun 08, 2017 at 13:47 UTC | |
by Corion (Patriarch) on Jun 08, 2017 at 13:56 UTC |