use WWW::Mechanize;
srand;
my $url = 'http://avantgardeconcierge.com/';
my $mech = WWW::Mechanize->new();
my @a = $mech->known_agent_aliases();
my $agent = $a[int(rand(@a))];
$mech->agent_alias( $agent );
$mech->get( $url );
my $content = $mech->content();
print "Using Agent: $agent\n";
print "Web Content: $content\n\n";
results in the same 500 EOF response... probably because WWW::Mechanize->get() wraps the LWP's get() method.
i just tested a syscall to lynx -source $uri and it works like a champ... but i really wanted to avoid that syscall.
after looking at the resulting source code produced by lynx, i see dos-style carriage returns following all the headers returned by the avantgardeconcierge.com webserver...
it says its 'Server: Microsoft-IIS/6.0^M', but all other sites i pull source on using the exact same setup that report 'Server: Microsoft-IIS/6.0' do not have dos-style CR's as EOL markers.
maybe LWP is choking on the ^M's... and thats is what produces the 500 EOF's. interesting!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.