LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash script to log into website (https://www.linuxquestions.org/questions/programming-9/bash-script-to-log-into-website-752128/)

paul_l 09-02-2009 11:05 AM

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?

RaptorX 09-02-2009 12:23 PM

just wondering if you tried without saving the cookies?
when you go to the page with firefox do you get any problems?

paul_l 09-02-2009 03:32 PM

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...

RaptorX 09-03-2009 05:56 AM

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.


All times are GMT -5. The time now is 06:28 PM.