title: Scraping a dynamic ecommerce page with infinite scroll
body: <p>I'm using <code>rvest</code> in R to do some scraping. I know some HTML and CSS.</p>
  
  <p>I want to get the prices of every product of a URI:</p>
  
  <p><a href="http://www.linio.com.co/tecnologia/celulares-telefonia-gps/" rel="nofollow noreferrer">http://www.linio.com.co/tecnologia/celulares-telefonia-gps/</a></p>
  
  <p>The new items load as you go down on the page (as you do some scrolling).</p>
  
  <p>What I've done so far:</p>
  
  <pre><code>Linio_Celulares &lt;- html("http://www.linio.com.co/celulares-telefonia-gps/")
  
  Linio_Celulares %&gt;%
    html_nodes(".product-itm-price-new") %&gt;%
    html_text()
  </code></pre>
  
  <p>And i get what i need, but just for the 25 first elements (those load for default). </p>
  
  <pre><code> [1] "$ 1.999.900" "$ 1.999.900" "$ 1.999.900" "$ 2.299.900" "$ 2.279.900"
   [6] "$ 2.279.900" "$ 1.159.900" "$ 1.749.900" "$ 1.879.900" "$ 189.900"  
  [11] "$ 2.299.900" "$ 2.499.900" "$ 2.499.900" "$ 2.799.000" "$ 529.900"  
  [16] "$ 2.699.900" "$ 2.149.900" "$ 189.900"   "$ 2.549.900" "$ 1.395.900"
  [21] "$ 249.900"   "$ 41.900"    "$ 319.900"   "$ 149.900" 
  </code></pre>
  
  <p><strong>Question: How to get all the elements of this dynamic section?</strong> </p>
  
  <p>I guess, I could scroll the page until all elements are loaded and then use html(URL). But this seems like a lot of work (i'm planning of doing this on different sections). There should be a programmatic work around.</p>