webpage-screenshot

How to capture full web page using QtWebEngine?

此生再无相见时 提交于 2021-02-07 10:04:53
问题 I use the following code in a QWebEngineView object to capture a web page to an image: image=new QImage(w,h, QImage::Format_ARGB32); painter = new QPainter(image); render(painter); image->save(imagefilename); Unfortunately, it only renders part of the web page that is shown on the widget to the image. How to render the whole page to the image? 回答1: It is possible to hide webview and resize it to show the whole web page. I'm using PyQt5 (version 5.12), but the idea should apply to C++ Qt as

Cant draw the contents of a div onto a canvas using Html2Canvas without a timeout

微笑、不失礼 提交于 2021-01-27 15:50:42
问题 I am trying to capture the screenshot of a portion of the web-page in my web app using the following code. function getScreenshot(){ var content = document.querySelectorAll("div.class")[0]; setTimeout(function(){captureScreenshot()},10); function captureScreenshot() { html2canvas(content, { onrendered: function(canvas) { var newImg = document.createElement("img"); newImg.src = canvas.toDataURL(); var newAnchor = document.createElement("a"); newAnchor.href = newImg.src; newAnchor.download =

How to find the height of the entire webpage?

寵の児 提交于 2020-12-29 12:56:23
问题 I am working on a solution capturing screen-shots of websites. I am using the default example mentioned at slimerjs.org to get the job done. Screen-shots are great with this tool, but I need to take full height screen-shots of websites. When capturing screens of websites like http://www.yellowpages.com, I can get full length screens without having to mention any height parameter. But when I try this url: http://votingbecause.usatoday.com/ I only get screenshot of the set resolution (default:

How to find the height of the entire webpage?

孤街醉人 提交于 2020-12-29 12:54:48
问题 I am working on a solution capturing screen-shots of websites. I am using the default example mentioned at slimerjs.org to get the job done. Screen-shots are great with this tool, but I need to take full height screen-shots of websites. When capturing screens of websites like http://www.yellowpages.com, I can get full length screens without having to mention any height parameter. But when I try this url: http://votingbecause.usatoday.com/ I only get screenshot of the set resolution (default:

How to find the height of the entire webpage?

笑着哭i 提交于 2020-12-29 12:53:32
问题 I am working on a solution capturing screen-shots of websites. I am using the default example mentioned at slimerjs.org to get the job done. Screen-shots are great with this tool, but I need to take full height screen-shots of websites. When capturing screens of websites like http://www.yellowpages.com, I can get full length screens without having to mention any height parameter. But when I try this url: http://votingbecause.usatoday.com/ I only get screenshot of the set resolution (default:

Android webview takes screenshot only from top of the page

帅比萌擦擦* 提交于 2020-02-24 03:59:09
问题 I am doing a very simple task of taking a screenshot from my webView into a Bitmap... I do it like this: webView.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(webView.getDrawingCache(false)); webView.setDrawingCacheEnabled(false); Canvas canvas = new Canvas(bitmap); webView.draw(canvas); The problem is that the final bitmap is always showing the top of my web page content! I actually need it to take the screenshot from where I have scrolled the content but this is not

Browser screenshot as bitmap in WP7

匆匆过客 提交于 2020-01-13 05:56:20
问题 I'm trying to get the screenshot of a given URL as a bitmap image on the Windows Phone. The WebBrowser class does not seem to have the DrawToBitmap method. Any pointers on how to get this working? 回答1: You can't take a screenshot of the WebBrowser Control as there seems to be a bug with the way it works with WriteableBitmaps. An alternative method could be to send the URL to a web service which takes a screenshot on the server and returns it back to your app. 回答2: Use WriteableBitmap to

Does changing the user-agent setting in PhantomJS change the perspective of the screen capture/screenshot?

穿精又带淫゛_ 提交于 2019-12-24 07:41:03
问题 I am relatively new to using PhantomJS, and would like to take screenshots of our website to be diffd later on. What I am curious to know is whether or not changing the user-agent setting will affect the perspective of the screenshot (i.e. will the image appear different)? - If it will not, how would you suggest me being able to take screenshots emulating different browsers (hopefully using Phantom, but open to suggestions)? // PhantomJS Code page = require('webpage').create(); // Used for

Protractor capture screenshot on failure

痞子三分冷 提交于 2019-12-23 05:42:09
问题 I have written below code in afterEach method to capture screenshot on failure afterEach(function() { var passed = jasmine.getEnv().currentSpec.results().passed(); if (!passed) { browser.takeScreenshot().then(function(png) { //capturing screenshot here }; } }); But while executing getting below error.. Message: Failed: Cannot read property 'results' of undefined Stack: TypeError: Cannot read property 'results' of undefined how to remove above error... 回答1: currentSpec is not going to work

Protractor capture screenshot on failure

余生长醉 提交于 2019-12-23 05:42:09
问题 I have written below code in afterEach method to capture screenshot on failure afterEach(function() { var passed = jasmine.getEnv().currentSpec.results().passed(); if (!passed) { browser.takeScreenshot().then(function(png) { //capturing screenshot here }; } }); But while executing getting below error.. Message: Failed: Cannot read property 'results' of undefined Stack: TypeError: Cannot read property 'results' of undefined how to remove above error... 回答1: currentSpec is not going to work