cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: HELP PLS :(

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Mon, 13 Feb 2006 11:54:18 -0700

At 09:40 -0600 2/13/06, alsarkis_at_bil.com.mx wrote:
>When I put this URL
>http://www.scjn.gob.mx/Listas/Acuerdo/ListaConsultasFinal.asp?Organismo=26&Fecha=02/02/2006&Buscar=Buscar
> in my IE explorer I can get the page with information, but when I try to use
>curl liket this:
>
>curl -b cokkie -d "Organismo=26&Fecha=02/02/2006&Buscar=Buscar"
>http://www.scjn.gob.mx/Listas/Acuerdo/ListaConsultasFinal.asp

1) The URL is typical of an HTTP GET request. curl will accept it as is. The -d option is more for handling POST requests which are not included in the URL. Just leave the ? and following stuff where it is in the call to curl.

2) The site does need at least one cookie. It will relocate to another, default, URL if it's not there. You will need to use another call to curl to download whatever startup files you normally use. You may be able to save the header file and refer to it on the second call with the -b option. But that may not be enough. Did you have to go through a login procedure with a password?

3) You will probably need to record a complete transaction using a browser to see what is going on. LiveHttpHeaders for FireFox or, my favorite, the logfile created by iCab for Mac are appropriate.

I like to use perl to handle repeated calls to the curl tool. Others use the curl library with a compiled language like C. If you would like a sample using perl and curl on Mac OS X or Linux please ask off line. You'll have to learn perl but it's a worth-while pursuit.

-- 
--> From the U S of A, the only socialist country that refuses to admit it. <--
Received on 2006-02-13