It is not exactly "reparsing" actually. From what I understand this is about detecting the changes made on the page. For that, you should use WebDriverWait
and a set of built-in expected conditions (or you can write a custom one) to wait for that change to be made on the page.
Let's say, for instance, an element is added to the page when you click the button. Here is how to wait until this element is visible:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# ...
button.click()
wait = WebDriverWait(driver, 10)
wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, "#id-of-the-added-element")))
# now the page is "re-parsed"
print(driver.page_source)
It would wait up to 10 seconds checking the state of the expected condition every 500 milliseconds (by default).