As discussed in the chatterbox, I think that this answers your question best, of the multiple times it has been answered.
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
| [reply] |
Hmm.
I've got the user-agent able to download the webpage ok, but I'm still having trouble with the cookies.
Apparently HTTP::Cookies uses its own cookie file. However I have the cookie on my machine in internet explorer format. There's no way for me (that _I_ know of at least :)) to get the cookie using the user agent, because that requires that I submit a form. (i.e. I submit a form with login + pass, it logs me in and sets the cookie). Now I have already logged in and told it to store my cookie - how do I "transfer" this cookie to HTTP::Cookies?
| [reply] |
See lwpcook, specifically the section on "Cookies." It is indeed possible to put together a request which "submits" a form, gets the cookie that is returned, and use it in later requests. This is an example of such, in fact, even using PerlMonks as an example.
Alternatively, you can find the file on your hard drive where IE stores the cookie, look at the name and value, and hard-code those in as a cookie.
On the gripping hand, you can visit the site in Netscape or compatible browser, and get a cookie. HTTP::Cookies knows how to read Netscape cookie files, and you can just tell it to read the cookie file that Netscape has produced with the cookie you want.
You'd almost get the feeling that There Is More Than One Way To Do It, wouldn't you? :)
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
| [reply] |
If you really wanted a challenge and were running on Windows, you could always use PerlCOM to manipulate the IE browser enginer using IWebBrowser. It's bloated and slow, and like all M$ stuff it would leak the cookies to the site if it requested it.
I feel so dirty....must take shower. | [reply] |