wget to login to a website
Hi All,
I am trying to login to a website using wget like this: wget --save-cookies=cookie.txt --post-data "Login Id=test&password=xxx" http://url and I get the contents of the login screen and not the screen after that. I do not even know if it has logged in. I used "Login Id=" because thats the name of that field in the page. I also tried wget -d --http-user=test --http-passwd=xxx http://url and I get the same page. I want to a) ensure that I am logged in b) get the page post login. Any help is greatly appreciated. Rgds, Uks |
Have you tried something like this?:-
Code:
wget --user=xxxx --password=xxxx http://url |
Hi Ian,
password or passwd is not recognized. Says, wget:unrecognized option '--password=xxxx' Rgds Uks |
Your version of wget must be different to mine then, because I use --user=xxx and --password=xxx in scripts regularly. I'm running on CentOS 5.2 with the following wget version:-
Code:
2.6.18-92.1.6.el5.centos.plusxen[root@www ~]# wget --version |
I am trying to install that version, Ian. And I am stuck with the library files....its giveing me a hard time.
I will let you know once I am done installing. |
No, that does not help me either.
The output of wget <url> and wget --user=xxxx --password=xxxx http://url appears to be the same. Anything else I could try ? |
Login using cookies
I've faced with the same issue and could not login with --user and --password parameters. But I have managed to login and download the site using cookies.
What I've done is; - Clear all the cookies of browser - Login to the page that I want to download - After successful login, export cookies to a file (cookies.txt) - For Firefox, you can use "Export Cookies" plugin for exporting. - wget --load-cookies=cookies.txt [other options ...] |
All times are GMT -5. The time now is 11:32 AM. |