LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-29-2008, 10:24 AM   #1
uks
Member
 
Registered: Jul 2007
Posts: 68

Rep: Reputation: 16
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
 
Old 07-29-2008, 11:12 PM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
Have you tried something like this?:-
Code:
wget --user=xxxx --password=xxxx http://url
 
Old 07-30-2008, 02:39 AM   #3
uks
Member
 
Registered: Jul 2007
Posts: 68

Original Poster
Rep: Reputation: 16
Hi Ian,

password or passwd is not recognized.
Says, wget:unrecognized option '--password=xxxx'

Rgds

Uks
 
Old 07-30-2008, 06:10 AM   #4
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 4&5, Fedora 10, CentOS 5.4, IPCop
Posts: 569

Rep: Reputation: 55
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
GNU Wget 1.10.2 (Red Hat modified)

Copyright (C) 2005 Free Software Foundation, Inc.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
2.6.18-92.1.6.el5.centos.plusxen[root@www ~]#
 
Old 07-31-2008, 03:18 AM   #5
uks
Member
 
Registered: Jul 2007
Posts: 68

Original Poster
Rep: Reputation: 16
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.
 
Old 08-06-2008, 05:05 AM   #6
uks
Member
 
Registered: Jul 2007
Posts: 68

Original Poster
Rep: Reputation: 16
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 ?
 
Old 11-01-2012, 04:44 AM   #7
elronx
LQ Newbie
 
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
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 ...]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wget through an authenticated website davee Linux - Networking 2 02-11-2009 04:57 AM
Problems mirroring an asp website with wget el_pajaro! Linux - General 1 02-16-2008 11:19 PM
How to wget a random file from a website, then use FEH to view it. xmrkite Linux - Software 3 10-17-2006 01:26 PM
using wget to download all videos from a website fakie_flip Linux - Software 3 08-16-2006 05:02 AM
wget - retrieving one folder of website davidhayter Linux - Software 4 03-07-2005 08:20 PM


All times are GMT -5. The time now is 10:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration