title: How to get page source after button click using selenium
body: <p>I am trying to get page source after clicking on search button. This is my code:</p>
  
  <pre><code>WebDriver driver = new ChromeDriver();
  driver.get(page);
  WebElement el = driver.findElement(By.xpath(xpath)); // button
  el.click();
  driver.getPageSource();
  </code></pre>
  
  <p>and this code returns the page source of the first page, not the one that was loaded after the click ...</p>