Thread

Posted on Tue Feb 6 18:37:18 2007 by adig
Can't login to site
Hi, I'm using version 0.009 and IE-7 and trying to login to the following site: https://hb2.bankleumi.co.il/TRADE/bllUsers/login_secured/Login0.asp I think that the problem is with the forms: It says that the number of forms is 0 even though there is a form name "form2". I'm using the following code:
use strict; use warnings; use Win32::IE::Mechanize; my $url = "https://hb2.bankleumi.co.il/TRADE/bllUsers/login_secured/Login0.asp"; my $ie = Win32::IE::Mechanize->new( visible => 1 ); $ie->get( $url ); my @forms = $ie->forms(); print scalar @forms; exit;
The output of this code is: 0. 1. Did anyone used this module with this site ? 2. Did anyone see this kind of problem ? 3. Is this module support IE ver 7 ? Thanks for your help adi
Direct Responses: 4267 | Write a response
Posted on Wed Feb 7 01:06:55 2007 by abeltje in response to 4256
Re: Can't login to site
Hi, 1 + 2) That page contains frames, you'll have to use the follow_link() method to load the frame-source. Th +at should give you the content of the frame and thus the form(s) on it. 3) As a matter of record, I haven't tested the code against IE 7; so you're on your own here. HTH, -- Abe.
Direct Responses: 4303 | Write a response
Posted on Fri Feb 9 18:26:25 2007 by adig in response to 4267
Re: Can't login to site
Thanks Abe. It helped and solved the problem. But I want to ask how... I changed the code to the following:
$ie->get( $url ); $ie->follow_link(); $ie->submit_form( fields => { uid => 'uid', password => 'pass', auth_field => 'field', }, );
My questions are as follow: 1. When I load the page directly at IE, and click on view source, I get that the page has a form. Why do I need to use the follow_link() ? I'm using the same link that I use in IE here ? 2. How did it go to the right frame without putting any params at the follow_link() ? Is it because there is only 1 link / 1 frame at that page ? 3. How did it take the right submit button ? I know that there are 2 buttons at that page: Enter & Cancel ?
Direct Responses: 4311 | Write a response
Posted on Sat Feb 10 13:53:52 2007 by abeltje in response to 4303
Re: Can't login to site
Hi, answers to questions: 1) there is a difference in IE between right-click>view source and Menu View>source 2) the default argument to find_link() which is called bij follow_link() is "n => 1", so yes, it wi +ll follow the first "link" it can find (see the docs for find_link()). 3) if you call submit_form() without a "button" argument, it will call the submit() method of the f +orm directly (see the docs for submit_form()). HTH, -- Abe.
Direct Responses: 4314 | Write a response
Posted on Sun Feb 11 01:02:29 2007 by adig in response to 4311
Re: Can't login to site
Thanks Abe very much for your kind and help. Adi.
Write a response