Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

How to screen capture a web page on the specified server #11209

Closed
hujunya opened this issue Apr 6, 2013 · 1 comment
Closed

How to screen capture a web page on the specified server #11209

hujunya opened this issue Apr 6, 2013 · 1 comment
Labels

Comments

@hujunya
Copy link

hujunya commented Apr 6, 2013

I want to screen capture a website page on one specified server in the cluster , and the website is not the default website on the server. So I should send the HTTP request with the HOST . I modified the /example/rasterize.js, like this:

/*****************************************************_/
var page = require('webpage').create(),
system = require('system'),
address, output, /_size
/host;

if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth_paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in_7.5in", "10cm_20cm", "A4", "Letter"');
phantom.exit(1);
} else {
address = system.args[1];
output = system.args[2];
host = system.args[3]
page.viewportSize = { width: 600, height: 600 };
/_
if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") {
size = system.args[3].split('');
page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' }
: { format: system.args[3], orientation: 'portrait', margin: '1cm' };
}
if (system.args.length > 4) {
page.zoomFactor = system.args[4];
}
*/
page.customHeader = {
'HOST':host
}
page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.render(output);
phantom.exit();
}, 200);
}
});
}
/
******************************************************/

I use “ phantomjs rasterize.js http://192.168.*.*/index.aspx index.jpg www.mywebsite.com " to capture screen.

It now can screen capture the website page on the specified server. But it only capture the base page of the website. If the meta in the page is not on this server, it can not be captured.

So how can I capture the whole page with the "HOST:www.mywebsite.com" in the request ?

@stale stale bot added the stale label Dec 27, 2019
@stale
Copy link

stale bot commented Dec 30, 2019

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 stale bot closed this as completed Dec 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant