title: Page Load for extracting from Google chrome
body: <p>I have found a few related questions, but none was able to solve my problem, so any help is greatly appreciated!</p>
  
  <p>I am fairly new to coding and am creating a JavaScript extractor for the chrome console. I am loading a search page, but when Javascript attempts to extract the information, the search is not loaded yet.</p>
  
  <p>I tried a for loop to pause my script, but turns out the page load is paused during that time. I found something like this:</p>
  
  <pre><code>for(var i=0; i &lt; 1000000; ++i) {
      setTimeout(function(i) {
          return function() { dosomethingheavy(i); }
      }(i), 0);
  }
  </code></pre>
  
  <p>but it did not work right (or I did not know how to use it properly). I structured my code like this:</p>
  
  <p>For loop to go to each page, extract info from page, go to next page, in the end it returns a csv file of all the data.</p>
  
  <p>My question is how can I allow for the ca. 2 sec page load?</p>
  
  <p>Thank you very much!</p>