LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-02-2009, 11:05 AM   #1
paul_l
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
Bash script to log into website


I'm trying to make a bash script that's supposed to log in to a web page and download some information. However I keep getting a html-file telling me that my browser doesn't support cookies. The wget-line I'm trying to use is
Code:
wget --save-cookies cookies.txt --keep-session-cookies --post-data="username=foo&password=bar" "http://form-action-url/
I've tried similar things with cURL too, but without any luck. What should I do to fix the cookies-problem?
 
Old 09-02-2009, 12:23 PM   #2
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
just wondering if you tried without saving the cookies?
when you go to the page with firefox do you get any problems?
 
Old 09-02-2009, 03:32 PM   #3
paul_l
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Yup, I've tried without cookies. Firefox logs me in without any problems. Maybe there's an alternative way of doing this? I'm kind of stuck right now...
 
Old 09-03-2009, 05:56 AM   #4
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
actually the way you are doing it should be correct, maybe the web page has some restrictions, like facebook which if you try to access with lynx or links it simply tells you "go and get a real browser like firefox" so probably you can make a script which uses firefox to do the task... but i am not sure if that is possible, maybe a more experienced user can step in and help.
 
  


Reply

Tags
bash, wget


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Script to log off of ssh connection Betzie Programming 4 07-07-2009 04:29 PM
log monitor bash script tronica Programming 5 05-14-2008 02:53 AM
how to log everything from a bash script to a file prodsac Linux - Server 2 04-15-2008 04:56 PM
Clean log bash script? QuarQuar Linux - General 4 10-27-2007 11:46 PM
Bash script for server log (namely var/log/messages) tenaciousbob Programming 17 05-24-2007 10:43 AM


All times are GMT -5. The time now is 08:13 PM.

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