Reparse Page Selenium Web Driver - Python -
is possible reparse page using selenium? click button using function html changes because of javascript , want reparse page, not refresh it.
the methods of get/refresh cause page reload isn't i'm looking for.
it not "reparsing" actually. understand detecting changes made on page. that, should use webdriverwait
, set of built-in expected conditions (or can write custom one) wait change made on page.
let's say, instance, element added page when click button. here how wait until element visible:
from selenium.webdriver.common.by import selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec # ... button.click() wait = webdriverwait(driver, 10) wait.until(ec.visibility_of_element_located((by.css_selector, "#id-of-the-added-element"))) # page "re-parsed" print(driver.page_source)
it wait up to 10 seconds checking state of expected condition every 500 milliseconds (by default).
Comments
Post a Comment