当画布高度改变时,我试图截取网页的截图。其默认高度为557。我希望selenium等待高度更改为557以外的任何其他值。有办法吗
<canvas id="faceCanvasPhoto" width="600" height="557" class="center-block reportCanvas">
Your browser does not support the canvas element.
</canvas>
我尝试了EC.visibility\u的元素定位,但没能捕捉到它
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)
定义您的等待类:
并称之为:
无论iframe长度是否从59更改,这都将打印true或false。如果不等到10秒,它就会改变,否则超时
相关问题 更多 >
编程相关推荐