title: Waiting for get requests to finish in selenium
body: <p>For this example let's look at the site pinterest:</p>
  
  <p>When i make the initial login, there is a loading of pins.
  In order to get more pins i need to scroll to the end of the page, after there is a request made for more pins (Lot's of sites are working like that i suppose)</p>
  
  <p>So i know how to do the scroll in selenium, but how do i wait for the request to end?</p>
  
  <p>I mean, it's not waiting for certain element to appear, the kind of element (The pins) is already there but i am waiting for others to appear.</p>
  
  <p>If i use expected condition with wait, it good for the first batch of pins, but those that add to them, how do i wait for them, example:</p>
  
  <p>When pinterest first load-></p>
  
  <pre><code>WebDriverWait driverWait = new WebDriverWait(cd, 10, 1000);
  
  element = driverWait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("thepins")));
  </code></pre>
  
  <p>Which is great for the initial loading, now i scroll to the bottom of the page </p>
  
  <pre><code>((JavascriptExecutor) cd).executeScript("window.scrollTo(0, document.body.scrollHeight)");
  </code></pre>
  
  <p>Now depends on the page, there is a loading to more pins(And sometimes not) i want to wait for them to load before i do another scroll.</p>
  
  <p>What is the best approach to this situation?</p>