Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Get non transformed XML

by Danikar (Novice)
on Nov 22, 2007 at 08:57 UTC ( #652329=note: print w/replies, xml ) Need Help??


in reply to Re: Get non transformed XML
in thread Get non transformed XML

I just tried the code below and recieved the same thing =(
require LWP::UserAgent;

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent('Mozilla/5.0');

my $response = $ua->get('http://www.wowarmory.com/');

if ($response->is_success) 
{
	print $response->content;  # or whatever
}
else 
{
	die $response->status_line;
}

Replies are listed 'Best First'.
Re^3: Get non transformed XML
by Gangabass (Vicar) on Nov 22, 2007 at 09:06 UTC

    I think this not enough.

    Try this UserAgent:

    $ua->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1 +) Gecko/2006120418 Firefox/2.0.0.1');

    If this not help when try UserAgent which your browser send to target site (you can see it with HTTP::Proxy).

      That worked!

      Thanks a lot.

Re^3: Get non transformed XML
by erroneousBollock (Curate) on Nov 22, 2007 at 09:10 UTC
    Firefox DownThemAll addon retrieves 183 bytes.
    wget retrievies 23k.

    I think it's safe to say it's some sort of header :-)

    Update: fixed in first reply.

    -David

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://652329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2021-12-09 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?