Interacting with a website using Perl and LWP
I'm trying to write a Perl script that will go out to a website, log in, pull up a query page, fill-in and submit the query, extract a few specific lines from the query results, and finally place that output into a file.
I'm having difficulty with the log in portion. It appears that rather than using the built-in Apache authentication, the developer decided to write their own authentication scheme that uses cookies. I setup a cookie jar but I'm not certain I'm actually getting and keeping the cookie. When I try to go to a page after the log in page I get an error saying I'm not logged in or my session has expired. Here's the code as I have it thus far. Code:
#!/usr/bin/perl Tom P.S. I had to sanitize a few things from my code. i.e. username and password |
I haven't read the documentation, but does
Code:
"/Perl/cookies.lwp" |
The path is not really relevant and I'm certain that is not the problem. I'm building the script in my home directory and the cookie file is actually in the same directory as the script itself. I just changed the path in my posting from the actual path I used for security reasons. I don't think sharing my username with the world is a good idea.
|
All times are GMT -5. The time now is 02:24 AM. |