I have looked at that module and I don't see how to use a cookie_jar with it to first login to their website. I am looking through the module on cpan with the doc therein contained.
I have put a TON of time into this and don't want to start at ground zero, unless I have to.
Therefore, how would I get what I have already written to work?
I added all the form fields to the LWP version I made, but it does not seem to be doing it right. Is there a way to make this code here work:
my $_cookie_file = "/home/first/cook/.lwp_cookies.dat";
$_post_url = 'http://www.eb2b.net/E2B_UMLogOn.process';
# Create new LWP::UserAgent object
$browser = LWP::UserAgent->new;
# Add a new Cookie Jar to the LWP Object
$browser->cookie_jar(HTTP::Cookies->new("file" => $_cookie_file));
# Spoof a very capable browser
# Allow https protocol and http....
$browser->protocols_allowed( [ 'http', 'https'] );
# Add the HTTP::Request for POST...
$req = HTTP::Request->new("POST" => "$_post_url");
# Add "content type" as form encoded
# Add the "Form fields" that are contained in the page...
+nd=User with this name was not found.&hMsgInvalidPassword=Logon not v
# Spoof the referrer to make the site think it's a person
# from the login page...
# Ok, now Perform Task
$response = $browser->request($req);
# This is not working as it is posting in the 'ELSE' statement. It is
+actually posting this in the "$response->content" field:
<!-- IWLoadCurrentCustomerLocale.tem -
-- Copyright (c) 1997 InterWorld Corporation -->
<META HTTP-EQUIV=REFRESH CONTENT="1;URL=/E2B_UMLogOn.process">
<TITLE>Refresh User Repository</TITLE>
<FONT SIZE="3" FACE="verdana, arial, helvetica">Please click here to c
If not I'll try to figure out how to use the WWW::Mechanize module.
Thank you for any further assistance you can be.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.