0

I would like to log in to my bank account website with cURL, so as to be able to retrieve a set of instruments.

I managed to login and save a cookie with the following command:

curl --user my_usernname:my_password --cookie-jar my-cookie.jar https://www.mybank.com/identification/default.cgi # this succeeds

However, when I try to dump the content of a specific aspx page, it does not work. I use the following command:

curl.exe -v --cookie my-cookie.jar https://www.mybank.com/listOfInstruments.aspx  

I have something more or like in the following:

* STATE: PROTOCONNECT => DO handle 0x600056540; line 1208 (connection #0)
* STATE: DO => DO_DONE handle 0x600056540; line 1281 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x600056540; line 1407 (con nection #0)
* STATE: WAITPERFORM => PERFORM handle 0x600056540; line 1420 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
< Location: https://www.mybank.com/identification/default.cgi
* STATE: PERFORM => DONE handle 0x600056540; line 1590 (connection #0)
* Connection #0 to host www.mybank.com left intact

How can I access and download data from aspx pages with cURL?

Is there a simpler way to do it (lynx, ..)?

Thanks

Community
  • 1
  • 1
Carmellose
  • 4,815
  • 10
  • 38
  • 56
  • 3
    Possible duplicate of http://stackoverflow.com/questions/18474690/is-there-a-way-to-follow-redirects-with-command-line-curl - you need the `-L` switch to follow the redirect. – javabrett Aug 01 '15 at 22:54
  • https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection – gerrytan Aug 01 '15 at 23:41

1 Answers1

0

As javabrett said, using the -L option to follow the redirect does the job.

Carmellose
  • 4,815
  • 10
  • 38
  • 56