driver.find_element_by_css('#canvas-xyz').save_screenshot('canvas.png')
AttributeError: 'WebElement' object has no attribute 'save_screenshot'
document.querySelector('#canvas-xyz').toDataURL()
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABq8AAAAhCAYAAABHnTGeAAAEQ0lEQVR4Xu3ZMREAAAwCseLfdG38kCrgUjZ2jgABAgQIECBAgAABAgQIECBAgAABAgQIECBAgEBEYJEcYhAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBA445USECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIZASMV5lXCEKAAAECBAgQIECAAAECBAgQIECAAAECBAgQIGC80gECBAgQIECAAAECBAgQIECAAAECBAgQIECAAIGMgPEq8wpBCBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIEjFc6QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgkBEwXmVeIQgBAgQIECBAgAABAgQIECBAgAABAgQIECBAgIDxSgcIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQyAsarzCsEIUCAAAECBAgQIECAAAECBAgQIECAAAECBAgQMF7pAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAQEbAeJV5hSAECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQLGKx0gQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBDICBivMq8QhAABAgQIECBAgAABAgQIECBAgAABAgQIECBAwHilAwQIECBAgAABAgQIECBAgAABAgQIECBAgAABAhkB41XmFYIQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgYr3SAAAECBAgQIECAAAECBAgQIECAAAECBAgQIEAgI2C8yrxCEAIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAeOVDhAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECGQEjFeZVwhCgAABAgQIECBAgAABAgQIECBAgAABAgQIECBgvNIBAgQIECBAgAABAgQIECBAgAABAgQIECBAgACBjIDxKvMKQQgQIECAAAECBAgQIECAAAECBAgQIECAAAECBIxXOkCAAAECBAgQIECAAAECBAgQIECAAAECBAgQIJARMF5lXiEIAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQICA8UoHCBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIEMgLGq8wrBCFAgAABAgQIECBAgAABAgQIECBAgAABAgQIEDBe6QABAgQIECBAgAABAgQIECBAgAABAgQIECBAgEBGwHiVeYUgBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECxisdIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQyAgYrzKvEIQAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQMB4pQMECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIZAeNV5hWCECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIGK90gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAICPwDiwAIhIPZYcAAAAASUVORK5CYII=
是否可以在Python中使用chromedriver和selenium对元素进行截图。我知道chrome开发工具允许我们对特定元素进行截图。即使是JavaScript方法,我也可以使用driver.execute_script()
命令获取数据URI。
element = driver.find_element_by_css('#canvas-xyz')
scrrenshot = element.screenshot_as_png
with open('canvas.png', 'wb') as f:
f.write(scrrenshot)
你好,selenium正在拍摄的图像被剪切,出现了页面滚动条(向上/向下&向右/向左),有没有办法使用selenium拍摄移动视图的截图? 对于移动 最后在两者上
所以我看到了一个特殊的例外,我敢肯定的是谷歌地图的绘图代码。 我有一个片段,在那里我以编程方式添加了一个支持地图片段,然后我在其中操纵谷歌地图实例。 这是stacktrace: 我无法可靠地复制它(尽管这种情况经常发生),我已经查看了ReadWriteDirectByteBuffer和ShortToByteBufferAdapter,但没有任何东西突然出现在我面前。 有什么想法吗?
我认为问题是我需要添加构建提示。我可以找到在哪里添加他们,但我不确定他们应该是什么格式。我也不知道要补充什么。我想我发现了一个帖子,说我需要添加Android.xapplication=Android:value=“Your Key”/>Android.xPermissions= 但我不确定构建提示条目表单中的格式是什么
LSV默认的对谷歌影像进行了加载,如果需要加载其他的谷歌地图数据,可以通过LSV中直接点击即可加载。
我在使用html2canvas。js库,用于与selenium一起拍摄全页屏幕截图。 我保存了html2canvas。我的java项目的类路径中的js文件。我用来获取屏幕截图的java脚本代码是: 我能够捕获flipkart页面的全页屏幕截图,但其中没有任何图像。 我无法使用Chrome的TakeScreenshot实用程序,因为它不允许使用Chrome浏览器拍摄整页屏幕截图。
我正试图从这个链接中抓取评论: https://www.google.com/search?q=google回顾第二次机会治疗40街 对于我使用以下代码加载页面的内容 页面加载很好,它没有向下滚动,我已经对其他网站(如 linkedn)使用了相同的代码,并且它在那里工作。