Hi All,
I've done my best to figure this out but I've reached a point where I
don't even know where to look for answers.  I am using Mechanize and
SSLeay to connect to a secure site.  After I make the connection (which
works) I try to login to the site.  When I post I get an error back from
the server saying it had a vb script mismatch error.  It sounds to me
like it's looking for one kind of variable and I'm passing the wrong
one.  Below I have my simple code, some debug, and the server error.  If
anyone could just point me in some kind of direction on what to do or
where to look for answers I would realllllly appreciate it.  I've been
trying to get this to work for about a week and a half now......  In the
end all's I need to do is logon to the site and download and excel file.
I tried this first in vb script but course that's crap with the
sendkeys.  Wont work with the secure screensaver on.  Knowing some Perl
from a while ago I knew it must have a solution.
 
**********************code***********************************
#!/usr/bin/perl
 
    
    use warnings;
    use strict;
    use Crypt::SSLeay;
    use WWW::Mechanize;
    use CGI;
    
 
    my $cgi = CGI->new();
    my $form = $cgi->Vars;
 
    my $agent = WWW::Mechanize->new();
    $agent->cookie_jar(HTTP::Cookies->new());
 
    my $login = "user";
    my $pass = "pw";
    use LWP::Debug qw(+);
    $agent->agent_alias( 'Windows IE 6' );
 
    $ENV{HTTPS_PROXY} = 'my.proxy.com';
 

    $agent->get('https://www.somehttpssite.com/webnews/login.asp');
    
    $agent->submit_form( 
            form_number => 1, 
            fields      => { userID => $login, password => $pass }, 
); 
 
    $agent->follow ( 'logout' ); 
    $agent->click();  
  
    print "Content-type: text/plain\n\n";
    print $agent->content();
 
**********************debug***********************************
LWP::UserAgent::new: ()
LWP::UserAgent::proxy: http my.proxy.com
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking www.somehttpssite.com for
cookies
HTTP::Cookies::add_cookie_header: Checking .nittsu.com for cookies
HTTP::Cookies::add_cookie_header: Checking nittsu.com for cookies
HTTP::Cookies::add_cookie_header: Checking .com for cookies
LWP::UserAgent::send_request: GET
https://www.somehttpssite.com/webnews/login.asp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 780 bytes
LWP::Protocol::collect: read 4096 bytes
LWP::Protocol::collect: read 139 bytes
HTTP::Cookies::extract_cookies: Set cookie ASPSESSIONIDCCTTBQRT =>
CAJPIIEAJMDEH
KLHNEKCKGBE
LWP::UserAgent::request: Simple response: OK
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking  www.somehttpssite.com for
cookies
HTTP::Cookies::add_cookie_header: - checking cookie path=/
HTTP::Cookies::add_cookie_header:  - checking cookie
ASPSESSIONIDCCTTBQRT=CAJPII
EAJMDEHKLHNEKCKGBE
HTTP::Cookies::add_cookie_header:    it's a match
HTTP::Cookies::add_cookie_header: Checking .nittsu.com for cookies
HTTP::Cookies::add_cookie_header: Checking nittsu.com for cookies
HTTP::Cookies::add_cookie_header: Checking .com for cookies
LWP::UserAgent::send_request: POST
https://www.somehttpssite.com/webnews/login.asp
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 788 bytes
LWP::Protocol::collect: read 741 bytes
LWP::UserAgent::request: Simple response: Internal Server Error
Content-type: text/plain
**********************error***********************************
<html>
  <head>
    <title>Nippon Express USA, Inc: Microsoft VBScript runtime
Error</title>
    <style>
      body { font-family:'Verdana'; font-weight:normal; font-size: .7em;
color:b
lack; }
      p { font-family:'Verdana'; font-weight:normal; color:black;
margin-top: 0.
3em; margin-bottom: 0.3em; padding-bottom: 0.3em; padding-top: 0.3em}
      b { font-family:'Verdana'; font-weight:bold; color:black;
margin-top: -5px
; }
      H1 { font-family:'Verdana'; font-weight:normal; font-size:14pt;
color:red;
 }
      H2 { font-family:'Verdana'; font-weight:bold; font-size:10pt;
color:maroon
; }
      pre { font-family:'Lucida Console'; font-size: .9em }
      .marker { font-weight: bold; color: black; text-decoration: none;
}
      .version { color: gray; }
      .error { margin-bottom: 10px; }
      .expandable { text-decoration:underline; font-weight:bold;
color:navy; cur
sor:hand; }
    </style>
  </head>
  <body>
<h1>Server Error in '/webnews' Application.<hr width='100%' size='1'
color='silv
er'></h1>
<h2><i>Microsoft VBScript runtime  Error</i></h2>
<p>
  <b>Description: </b>Type mismatch: 'Cint' (0x800A000D)
</p>
<p>
</p>
<p>
  <b>Source File: </b>/webnews/usercheck.asp
&nbsp;&nbsp;<b>Line:</b> 31
</p>
<p><b>Version Information: </b>Microsoft-IIS/6.0, CGI/1.1</p><br>
<hr width='100%' size='1' color='silver'>
<p><b>Nippon Express USA, Inc. </b><br>Please notify your Nippon Express
tech su
pport personnel or your representative in regards to this error.</p>
  </body>
</html>

Reply via email to