button = browser.find_element_by_name('button')
button.click()
WebDriverWait(browser, timeout=10).until(lambda x: x.find_element_by_id(
    'someId_that_must_be_on_new_page'))
page_source = browser.page_source
print(page_source)
Get page generated with Javascript in Python