mercredi 31 décembre 2014

How to retrieve table information using libcurl

I am new to using the libcurl libraries in C++ just to learn some new stuff, however i cant seem to find to much useful info on the subject with good practical examples.


I am trying to retrieve some stats from this website: http://ift.tt/1tBsZwm


For this, after the proper includes i am pulling the webpage using:



int main()
{
CURL *curl;
CURLcode res;

curl = curl_easy_init();
if(curl)
{
// Set URL
curl_easy_setopt(curl, CURLOPT_URL, "http://ift.tt/1AbOMKn
14/2015#r-madrid#all-player-positions#16#34#0#0#90#23/08/2014#14/11/2014#season#1#all-matches#total#desc#total");

// Perform the request, res will get the return code
res = curl_easy_perform(curl);

// Check for errors
if(res != CURLE_OK)
{
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}

// Print the code
cout << res << endl;

// Always cleanup each call to curl_easy_init
curl_easy_cleanup(curl);
}
return 0;
}


From the websites source code i can check for example that the name Messi is in Messi in . However if i run a search on the printed code i can´t see the name Messi, nor his stats anywhere. What am i missing so i can tell the site to download all the players data? Shouldnt this be done automatically when i give the URL?


I tried using something like this: Add paramethers to libcurl GET in c++ with no success.


Thanks in advance for some basic guidelines so i can continue with this.


Aucun commentaire:

Enregistrer un commentaire