If using python, you may use this function, which clicks the button and waits for the DOM change:
def click_n_wait(driver, button, timeout=5):
source = driver.page_source
button.click()
def compare_source(driver):
try:
return source != driver.page_source
except WebDriverException:
pass
WebDriverWait(driver, timeout).until(compare_source)
(CREDIT: based on this stack overflow answer)