Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use cURL to download the contents of webpages that require forms to get to.

In a browser it looks something like this

1.) Login using POST
2.) Pick which page to go to using another POST
3.) Pick another page... using POST
4.) etc.. until I get to the page I want, 
    then download all textfiles linked to on that page.

I am attempting to do this using a bash script and some loops with the values that change for each POST.

My problem is how do I do multiple POSTs with cURL? Must there be cookies involved?

FYI the website is (MG-RAST).

share|improve this question

I'm beginning to realize that I only post questions to stack* because I know that as soon as I do, I will figure out the answer.

The answer is indeed cookies:

$ curl -d "who=your_mom&when=last_night" -D mycookies
$ curl -d "what=took_her_out_for_a_steak" -b mycookies

-D saves to mycookies
-b loads mycookies

Add another -D to the second command and you might make it to 2nd base.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .