Re: UserAgent->get problem

Gisle Aas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.lwp
Message-ID <[email protected]>
On Sat, Nov 14, 2009 at 16:58, SHANG Yuan <[email protected]> wrote:
>  I want to submit my request to a website, and I successfully parse the
> "get" parameters.
>   When I paste the url('http://mywebsite/search?aa=1&bb=2&JSEnable=true')
> to firefox, it returns a successful value. However,
>     $response=$ua->get($url);
>   did not return the successful value.
> Did any kind spirit help me figure it out?

You need to provide more information about the actual server you try
to connect to in order to get any real advice.  My guess is that the
server cares about the User-Agent or Cookie headers.  Sniffing the
traffic that the browser generates when talking to the server might be
instructive.

--Gisle


>
>  By the way,the website need username and password.I have use the
> statements below to deal with it. And It seems work well, since I can
> get the content of the webpages without problems.
>
> my $response = $ua->post( $url,
>    [  loginID=>$username,
>         passwd => $passwd,
>    ]
>  );
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.