【发布时间】:2017-11-13 17:52:08
【问题描述】:
<canvas class="word-cloud-canvas" id="word-cloud-canvas-1892" height="270" width="320"></canvas>
如何使用 Selenium Python 从 HTML5 画布中获取图像的 URL 源?
我尝试使用
driver.execute_script("return arguments[0].toDataURL('image/png');", canvasElement)
但它只返回二进制文件?的图像。 我不想保存图像,而是获取图像的 URL。有可能吗?
【问题讨论】:
-
您能否说明其他选项(除了 selenium)是否可以接受,如果可以,请查看提供的解决方案?
标签: python html selenium html5-canvas