Note that there are some explanatory texts on larger screens.

plurals
  1. PODownloaded page source is different than the rendered page source
    primarykey
    data
    text
    <p>I'm planning to get data from this website</p> <p><a href="http://www.gpw.pl/akcje_i_pda_notowania_ciagle" rel="nofollow">http://www.gpw.pl/akcje_i_pda_notowania_ciagle</a></p> <p>(it's a site of the main stock market in Poland)</p> <p>I've got a program written in C++ that downloads source of the site to the file. But the problem is that it doesn't contain thing I'm interested in (stocks' value of course).</p> <p>If you compare this source of the site to the option "View element" ( RMB -> View element) you can see that "View element" does contain the stocks' values.</p> <pre><code>&lt;td&gt;75.6&lt;/td&gt; &lt;tr class="even red"&gt; </code></pre> <p>etc etc...</p> <p>The downloaded source of the site doesn't have this information.</p> <p>So we've got 2 questions</p> <p>1) Why does source of the site is different from the "View element" option?</p> <p>2) How to transfer my program so that it can download the right code?</p> <pre><code> #include &lt;string&gt; #include &lt;iostream&gt; #include "curl/curl.h" #include &lt;cstdlib&gt; using namespace std; // Write any errors in here static char errorBuffer[CURL_ERROR_SIZE]; // Write all expected data in here static string buffer; // This is the writer call back function used by curl static int writer(char *data, size_t size, size_t nmemb, string *buffer) { // What we will return int result = 0; // Is there anything in the buffer? if (buffer != NULL) { // Append the data to the buffer buffer-&gt;append(data, size * nmemb); // How much did we write? result = size * nmemb; } return result; } // You know what this does.. void usage() { cout &lt;&lt;"curltest: \n" &lt;&lt; endl; cout &lt;&lt; "Usage: curltest url\n" &lt;&lt; endl; } /* * The old favorite */ int main(int argc, char* argv[]) { if (argc &gt; 1) { string url(argv[1]); cout&lt;&lt;"Retrieving "&lt;&lt; url &lt;&lt; endl; // Our curl objects CURL *curl; CURLcode result; // Create our curl handle curl = curl_easy_init(); if (curl) { // Now set up all of the curl options curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer); curl_easy_setopt(curl, CURLOPT_URL, argv[1]); curl_easy_setopt(curl, CURLOPT_HEADER, 0); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;buffer); // Attempt to retrieve the remote page result = curl_easy_perform(curl); // Always cleanup curl_easy_cleanup(curl); // Did we succeed? if (result == CURLE_OK) { cout &lt;&lt; buffer &lt;&lt; "\n"; exit(0); } else { cout &lt;&lt; "Error: [" &lt;&lt; result &lt;&lt; "] - " &lt;&lt; errorBuffer; exit(-1); } } } return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload