|
|
Posted by J.O. Aho on 03/01/07 16:06
Andrea wrote:
>> It's a lot easier if you use wget, it supports sessions and cookies, you first
>> use wget to get the page to your local machine and then process the file in php.
>
> Well...but how to login via wget???
I guess it's a normal form, password and login that is sent and that is
usually done with a POST, so you will need to use the --post-data option, you
may want to lie that you are using a browser, in that case you use
--user-agent. For the session cookie you need to use the --save-cookies option
You use the wget once for the login and then once for fetching the page you
wanted.
For further information, I suggest you take a look at the wget man page:
man wget
Simple example from the man page:
get --save-cookies cookies.txt --post-data 'user=foo&password=bar'
http://server.com/auth.php
wget --load-cookies cookies.txt -p http://server.com/interesting/article.php
--
//Aho
Navigation:
[Reply to this message]
|