Thanks,Gisle.
My access to the web-server can divide into 3 steps:
1.login.    Succeed.I get the same content using UserAgent as I login
through the web-browser.
2.ToABookingSystem   Succeed. This second webpage contains some
javaScripts.And from the web-browser, it turns to the thrid webpage after
clicking one link. The following is the corresponding web-page code:

<a href="#" onClick="childWin =
window.open('request?someparameter=a&otherparameter=b&etc','childWin','width=390,height=350,scrollbars=yes,status=yes,resizable=yes')"><P
style="Font-Size:12px"><img src="../pic.gif"
border="0"></p></a></div></td></tr>


3.Submit my request.  This third webpage comes from the second webpage. I
get the window.open "url" from the second webpage(mentioned above),paste
it to the web-browser, and get the same failure result as I get by perl
script. But after I have clicked the "pic.gif" in the second webpage from
the web-browser, I re-enter the "url" of the third webpage and this time
the browser returned just what I wanted.
It seems that the "click" action have activated something I haven't noticed.

Have anyone here come with the similar problems before?
Any advice will be appreciated.

Yuan SHANG


> On Sat, Nov 14, 2009 at 16:58, SHANG Yuan <s...@ust.hk> 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,
>>    ]
>>  );
>>
>>
>>
>


Reply via email to