Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/03/2014, 12:32
carbon
 
Fecha de Ingreso: enero-2012
Ubicación: Buenos Aires
Mensajes: 745
Antigüedad: 12 años, 4 meses
Puntos: 35
Respuesta: Descargar infomacion de una web en c++

Algo así:

Código C:
Ver original
  1. #include <stdio.h>
  2. #include <curl/curl.h>
  3.  
  4. int main(void)
  5. {
  6.   CURL *curl;
  7.   CURLcode res;
  8.  
  9.   curl = curl_easy_init();
  10.   if(curl) {
  11.     curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
  12.     /* example.com is redirected, so we tell libcurl to follow redirection */
  13.     curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  14.  
  15.     /* Perform the request, res will get the return code */
  16.     res = curl_easy_perform(curl);
  17.     /* Check for errors */
  18.     if(res != CURLE_OK)
  19.       fprintf(stderr, "curl_easy_perform() failed: %s\n",
  20.               curl_easy_strerror(res));
  21.  
  22.     /* always cleanup */
  23.     curl_easy_cleanup(curl);
  24.   }
  25.   return 0;
  26. }

Acá hay muchos ejemplos: http://curl.haxx.se/libcurl/c/example.html