简体   繁体   English

使用Robot Framework获取整个网页的屏幕截图

[英]Take a screenshot of an entire webpage using Robot Framework

I have a problem on taking a screenshot using robotframework. 我在使用robotframework拍摄屏幕截图时遇到问题。

Currently I am using keyword Capture Page Screenshot on Selenium2library. 目前,我在Selenium2library上使用关键字Capture Page Screenshot。 The problem is that, keyword only captures the webpage visible on the screen. 问题是,关键字仅捕获屏幕上可见的网页。 We needed a screenshot that could take the entire webpage. 我们需要一个可以占据整个网页的屏幕截图。 This means that when it capture a screenshot it should scroll down to the bottom of the webpage and capture the whole page. 这意味着当它捕获屏幕截图时,它应向下滚动到网页的底部并捕获整个页面。 Is that possible? 那可能吗?

Appreciate everyone can suggest if there are other library that we can use. 感谢每个人都可以建议我们是否可以使用其他库。

You can do that with a headless browser: 你可以用无头浏览器做到这一点:

http://phantomjs.org/ http://phantomjs.org/

Execute it from Python as a separate process if you need to, storing the result into a file. 如果需要,可以从Python执行它作为单独的进程,将结果存储到文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM