in reply to Re: method not supported
in thread method not supported
Well, I don't see the problem, and testing and tinkering with it I couldn't get your code to work. I did try assigning an agent name to make it look like the request was coming from Firefox instead of LWP::UserAgent, just in case the server is blocking robots.
I did re-write the code, to more closely match the synopsis given in the docs for LWP::UserAgent, and that seemed to do the trick:
use strict; use LWP::UserAgent; my $word = "happy"; my $url = "http://dic.naver.com/search.naver?mode=all&query=" . $word; my $agent = new LWP::UserAgent; $agent->agent('Firefox/1.5'); my $response = $agent->get( $url ); if( $response->is_success ) { print $response->content(); } else { die $response->status_line; }
See if you can adapt that to your needs, because it seemed to work fine for me.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: method not supported
by Anonymous Monk on Dec 28, 2005 at 17:34 UTC |