I am trying to take screenshot of webpage when canvas height changes. Its default height is 557. I want selenium to wait till height changes to any other value than 557. Is there any way to do that ?
<canvas id="faceCanvasPhoto" width="600" height="557" class="center-block reportCanvas">
Your browser does not support the canvas element.
</canvas>
I tried EC.visibility_of_element_located but couldnt catch it
try:
WebDriverWait(driver, 5).until(EC.visibility_of_element_located((By.XPATH, "//*[@id='faceCanvasPhoto']"))
)
driver.find_element_by_tag_name('body').screenshot(facemap +'.png')
except TimeoutException:
driver.find_element_by_tag_name('body').screenshot(facemap +'.png')
driver.implicitly_wait(1)