phantomjs icon indicating copy to clipboard operation
phantomjs copied to clipboard

screen shot is not accurate as its seeing in browser

Open nk-nareshkumar opened this issue 9 years ago • 5 comments

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version. : version : 1.9.8

  2. What steps will reproduce the problem? : I pasted my script in this issue.

  3. Which operating system are you using? : Ubuntu 14

  4. Did you use binary PhantomJS or did you compile it from source?

  5. Please provide any additional information below.

My words:

With this below code i tried to capture screen from a url but it seems its not giving perfect screen shot.. Or i am doing something wrong ?

screen shot : http://www.awesomescreenshot.com/image/2275399/7cf995d2e287cb87c4ca4895b6b69934

Website : http://www.whiteboardexplainers.com/

var system = require("system");
if (system.args.length > 0) {
    var page = require('webpage').create();
	page.viewportSize = {width: 1280, height: 1024};
    page.open(system.args[1], function() {
        var pageTitle = system.args[1].replace(/http.*\/\//g, "").replace("www.", "").split("/")[0]
        var filePath = "pageTitle + '.png';
        
        window.setTimeout(function () {
			page.evaluate(function() {
				document.body.bgColor = 'white';
			});  
			page.render(filePath);
        	console.log(filePath);
        	phantom.exit();
		}, 200);
        
    });
}

nk-nareshkumar avatar Mar 09 '17 06:03 nk-nareshkumar

@nk-nareshkumar you need to set clipRect to take a screenshot of a subsection of the screen.

jesg avatar Mar 09 '17 13:03 jesg

screen shot : http://www.awesomescreenshot.com/image/2275399/7cf995d2e287cb87c4ca4895b6b69934

Website : http://www.whiteboardexplainers.com/

In these both screen the only difference the header issue is coming in captured screenshot.. not getting why you suggested clipRect method,. correct me if i am wrong.

nk-nareshkumar avatar Mar 09 '17 16:03 nk-nareshkumar

your right.

i see the following in phantomjs 2.1.1: tmp

and on phantomjs 2.5.0-beta tmp

so it looks like a phantomjs 1.9.8 issue.

jesg avatar Mar 10 '17 09:03 jesg

ok.. thank you .. i will test after update the phantomjs package

nk-nareshkumar avatar Mar 10 '17 09:03 nk-nareshkumar

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

stale[bot] avatar Dec 29 '19 12:12 stale[bot]