ਵੈੱਬ ਨੂੰ ਕੈਪਚਰ ਅਤੇ ਕਨਵਰਟ ਕਰਨ ਲਈ ਟੂਲ

ਵੈਬਸਾਈਟ ਸਕ੍ਰੀਨਸ਼ਾਟ ਕੈਪਚਰ ਕਰੋ ਜਾਂ HTML ਨੂੰ ਚਿੱਤਰਾਂ ਵਿੱਚ ਬਦਲੋ

Node.js API

ਦੀਆਂ ਹੇਠ ਲਿਖੀਆਂ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਵੈਬਸਾਈਟਾਂ ਦੇ ਸੰਪੂਰਨ ਚਿੱਤਰ ਸਕਰੀਨਸ਼ਾਟ ਬਣਾਓ ਗਰੈਬਜ਼ਿਟ ਦਾ ਨੋਡ.ਜਜ਼ ਏਪੀਆਈ. ਪਰ ਤੁਹਾਨੂੰ ਸ਼ੁਰੂ ਕਰਨ ਤੋਂ ਪਹਿਲਾਂ ਯਾਦ ਰੱਖੋ ਕਿ ਫੋਨ ਕਰਨ ਤੋਂ ਬਾਅਦ url_to_image, html_to_image or file_to_image theੰਗ save or save_to ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਲਈ methodੰਗ ਨੂੰ ਬੁਲਾਉਣਾ ਲਾਜ਼ਮੀ ਹੈ.

ਮੁ Optionsਲੇ ਚੋਣਾਂ

ਵੈਬ ਪੇਜ ਜਾਂ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਲਈ ਸਿਰਫ ਇਕ ਪੈਰਾਮੀਟਰ ਦੀ ਲੋੜ ਹੁੰਦੀ ਹੈ HTML ਨੂੰ ਤਬਦੀਲ intਓਏ ਚਿੱਤਰ ਜਿਵੇਂ ਕਿ ਹੇਠਲੀ ਉਦਾਹਰਣ ਵਿੱਚ ਦਿਖਾਇਆ ਗਿਆ ਹੈ.

client.url_to_image("https://www.tesla.com");
//Then call the save or save_to method
client.html_to_image("<html><body><h1>Hello World!</h1></body></html>");
//Then call the save or save_to method
client.file_to_image("example.html");
//Then call the save or save_to method

ਚਿੱਤਰ ਸਕਰੀਨਸ਼ਾਟ ਫਾਰਮੈਟ

ਗਰੈਬਜ਼ਿਟ ਦਾ ਨੋਡ.ਜਜ਼ ਏਪੀਆਈ ਕਈ ਰੂਪਾਂ ਵਿੱਚ ਚਿੱਤਰ ਸਕਰੀਨਸ਼ਾਟ ਲੈ ਸਕਦਾ ਹੈ, ਜਿਸ ਵਿੱਚ ਜੇਪੀਜੀ, ਪੀਐਨਜੀ, ਡਬਲਯੂਈਬੀਪੀ, ਬੀ ਐਮ ਪੀ (ਐਕਸਐਨਯੂਐਮਐਕਸ ਬਿੱਟ, ਐਕਸਯੂ.ਐੱਨ.ਐੱਮ.ਐੱਮ.ਐਕਸ ਬਿੱਟ, 8 ਬਿੱਟ ਜਾਂ 16 ਬਿੱਟ) ਅਤੇ ਟੀਆਈਐਫਐਫ ਸ਼ਾਮਲ ਹਨ. ਚਿੱਤਰ ਦੇ ਸਕਰੀਨਸ਼ਾਟ ਦਾ ਡਿਫਾਲਟ ਫਾਰਮੈਟ ਜੇਪੀਜੀ ਹੈ. ਹਾਲਾਂਕਿ ਜੇਪੀਜੀ ਪ੍ਰਤੀਬਿੰਬ ਦੀ ਗੁਣਵੱਤਾ ਕੁਝ ਕਾਰਜਾਂ ਲਈ ਇੰਨੀ ਚੰਗੀ ਨਹੀਂ ਹੋ ਸਕਦੀ ਕਿ ਇਨ੍ਹਾਂ ਸਥਿਤੀਆਂ ਵਿਚ ਪੀ ਐਨ ਜੀ ਫਾਰਮੈਟ ਨੂੰ ਚਿੱਤਰ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲਈ ਸਿਫਾਰਸ਼ ਕੀਤੀ ਜਾਂਦੀ ਹੈ ਕਿਉਂਕਿ ਇਹ ਗੁਣਵੱਤਾ ਅਤੇ ਫਾਈਲ ਅਕਾਰ ਵਿਚ ਇਕ ਵਧੀਆ ਸੰਤੁਲਨ ਦਿੰਦਾ ਹੈ. ਹੇਠਾਂ ਦਿੱਤੀ ਉਦਾਹਰਣ ਇੱਕ ਚਿੱਤਰ ਸਕਰੀਨਸ਼ਾਟ ਨੂੰ ਦਰਸਾਉਂਦੀ ਹੈ ਜੋ PNG ਫਾਰਮੈਟ ਦੀ ਵਰਤੋਂ ਨਾਲ ਲਈ ਜਾ ਰਹੀ ਹੈ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"format":"png"};

client.url_to_image("https://www.tesla.com", options);
//Then call the save or save_to method
client.save_to("result.png", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"format":"png"};

client.html_to_image("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save or save_to method
client.save_to("result.png", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"format":"png"};

client.file_to_image("example.html", options);
//Then call the save or save_to method
client.save_to("result.png", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});

ਬਰਾ Browਜ਼ਰ ਦਾ ਆਕਾਰ

ਬ੍ਰਾ .ਜ਼ਰ ਦਾ ਆਕਾਰ ਬ੍ਰਾ browserਜ਼ਰ ਵਿੰਡੋ ਦੇ ਆਕਾਰ ਦਾ ਹਵਾਲਾ ਦਿੰਦਾ ਹੈ ਜਿਹੜੀ ਕਿ ਜ਼ਿਆਦਾਤਰ ਮਾਮਲਿਆਂ ਵਿੱਚ ਸਕ੍ਰੀਨਸ਼ਾਟ ਕੈਪਚਰ ਕਰਨ ਵੇਲੇ ਵਰਤੀ ਜਾਏਗੀ, ਇਸ ਨੂੰ ਸੈੱਟ ਕਰਨ ਦੀ ਜ਼ਰੂਰਤ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਸਾਰੇ ਬ੍ਰਾ .ਜ਼ਰ ਦੇ ਸਾਰੇ ਕੰਮਾਂ ਲਈ ਡਿਫੌਲਟ ਬਰਾ browserਜ਼ਰ ਦਾ ਅਕਾਰ ਕਾਫੀ ਹੋਵੇਗਾ. ਹਾਲਾਂਕਿ ਜੇ ਤੁਸੀਂ ਬਰਾ browserਜ਼ਰ ਦੀ ਚੌੜਾਈ ਅਤੇ ਉਚਾਈ ਸੈਟ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹੋ ਤਾਂ ਹੇਠਾਂ ਇਕ ਉਦਾਹਰਣ ਦਿਖਾਈ ਗਈ ਹੈ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserWidth":1366, "browserHeight":768};

client.url_to_image("https://www.tesla.com", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserWidth":1366, "browserHeight":768};

client.html_to_image("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserWidth":1366, "browserHeight":768};

client.file_to_image("example.html", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});

ਚਿੱਤਰ ਅਕਾਰ ਬਦਲੋ

ਕਿਸੇ ਚਿੱਤਰ ਦੇ ਆਕਾਰ ਨੂੰ ਬਦਲਣਾ ਸੌਖਾ ਹੈ, ਇਸ ਨੂੰ ਚਿੱਤਰ ਨੂੰ ਭੰਗ ਕੀਤੇ ਬਿਨਾਂ ਕਰਨਾ ਥੋੜਾ isਖਾ ਹੈ. ਸਾਰੀ ਪ੍ਰਕਿਰਿਆ ਨੂੰ ਸੌਖਾ ਬਣਾਉਣ ਲਈ ਅਸੀਂ ਤੁਹਾਨੂੰ ਇਸ ਦੀ ਵਰਤੋਂ ਕਰਨ ਦੀ ਸਿਫਾਰਸ਼ ਕਰਦੇ ਹਾਂ ਸਧਾਰਣ ਚਿੱਤਰ ਮਾਪ ਮਾਪ ਕੈਲਕੁਲੇਟਰ.

ਜੇ ਤੁਸੀਂ ਚਿੱਤਰ ਦੀ ਚੌੜਾਈ ਅਤੇ ਉਚਾਈ ਨੂੰ ਬ੍ਰਾ browserਜ਼ਰ ਦੀ ਚੌੜਾਈ ਅਤੇ ਉਚਾਈ ਤੋਂ ਵੱਡੇ ਆਕਾਰ ਵਿਚ ਵਧਾਉਣਾ ਚਾਹੁੰਦੇ ਹੋ, ਜੋ ਕਿ ਮੂਲ ਰੂਪ ਵਿਚ 1366 ਦੁਆਰਾ 728 ਪਿਕਸਲ ਹੈ, ਤਾਂ ਬਰਾ browserਜ਼ਰ ਦੀ ਚੌੜਾਈ ਅਤੇ ਉਚਾਈ ਨੂੰ ਵੀ ਮਿਲਾਉਣ ਲਈ ਵਧਾਉਣਾ ਲਾਜ਼ਮੀ ਹੈ.

ਕਸਟਮ ਪਛਾਣਕਰਤਾ

ਤੁਸੀਂ ਇੱਕ ਕਸਟਮ ਪਛਾਣਕਰਤਾ ਨੂੰ ਪਾਸ ਕਰ ਸਕਦੇ ਹੋ ਚਿੱਤਰ ਨੂੰ shownੰਗ ਜਿਵੇਂ ਹੇਠਾਂ ਦਰਸਾਏ ਗਏ ਹਨ, ਇਹ ਮੁੱਲ ਤਦ ਤੁਹਾਡੇ ਗਰੈਬਜ਼ ਨੋਡ.ਜੇਜ਼ ਹੈਂਡਲਰ ਨੂੰ ਵਾਪਸ ਕਰ ਦਿੱਤਾ ਜਾਵੇਗਾ. ਉਦਾਹਰਣ ਦੇ ਲਈ ਇਹ ਕਸਟਮ ਪਛਾਣਕਰਤਾ ਇੱਕ ਡੇਟਾਬੇਸ ਪਛਾਣਕਰਤਾ ਹੋ ਸਕਦਾ ਹੈ, ਜਿਸ ਨਾਲ ਸਕ੍ਰੀਨਸ਼ਾਟ ਨੂੰ ਕਿਸੇ ਵਿਸ਼ੇਸ਼ ਡਾਟਾਬੇਸ ਰਿਕਾਰਡ ਨਾਲ ਜੋੜਿਆ ਜਾ ਸਕਦਾ ਹੈ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.url_to_image("https://www.tesla.com", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.html_to_image("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.file_to_image("example.html", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});

ਪੂਰੀ ਲੰਬਾਈ ਸਕਰੀਨਸ਼ਾਟ

GrabzIt ਤੁਹਾਨੂੰ ਇੱਕ ਪੂਰੇ ਵੈੱਬ ਪੇਜ ਦੀ ਪੂਰੀ ਲੰਬਾਈ ਦਾ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਦੀ ਆਗਿਆ ਦਿੰਦਾ ਹੈ ਅਜਿਹਾ ਕਰਨ ਲਈ ਤੁਹਾਨੂੰ ਇੱਕ -1 ਨੂੰ ਪਾਸ ਕਰਨ ਦੀ ਜ਼ਰੂਰਤ ਹੈ browserHeight ਜਾਇਦਾਦ. ਇਹ ਨਿਸ਼ਚਤ ਕਰਨ ਲਈ ਕਿ ਚਿੱਤਰ ਬਰਾ theਜ਼ਰ ਦੇ ਆਕਾਰ ਨਾਲ ਮੇਲ ਖਾਂਦਾ ਹੈ ਇਸ ਨੂੰ ਇੱਕ -1 ਪਾਸ ਕਰਦਾ ਹੈ height ਅਤੇ width ਵਿਸ਼ੇਸ਼ਤਾ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserHeight":-1,"width":-1, "height":-1};

client.url_to_image("https://www.tesla.com", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserHeight":-1,"width":-1, "height":-1};

client.html_to_image("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"browserHeight":-1,"width":-1, "height":-1};

client.file_to_image("example.html", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});

ਤੁਸੀਂ ਥੰਬਨੇਲ ਵੀ ਵਾਪਸ ਕਰ ਸਕਦੇ ਹੋ ਜੋ ਕੱਟੇ ਨਹੀਂ ਹੋਏ ਹਨ, ਪਰ ਸਾਵਧਾਨ ਰਹੋ ਇਹ ਵੱਡੀਆਂ ਤਸਵੀਰਾਂ ਬਣਾ ਸਕਦਾ ਹੈ. ਅਜਿਹਾ ਕਰਨ ਲਈ ਇੱਕ ਨੂੰ -1 ਪਾਸ ਕਰੋ height ਅਤੇ/ਜਾਂ width ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ. ਉਹ ਮਾਪ ਜੋ ਐਕਸ-ਐੱਨ.ਐੱਨ.ਐੱਮ.ਐੱਮ.ਐਕਸ ਪਾਸ ਕੀਤਾ ਗਿਆ ਹੈ ਨੂੰ ਕੱਟਿਆ ਨਹੀਂ ਜਾਏਗਾ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"width":-1, "height":-1};

client.url_to_image("https://www.tesla.com", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"width":-1, "height":-1};

client.html_to_image("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"width":-1, "height":-1};

client.file_to_image("example.html", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
ਧਿਆਨ ਦਿਓ ਕਿ ਬਰਾ browserਜ਼ਰ ਦੀ ਪੂਰੀ ਲੰਬਾਈ ਚੌੜਾਈ ਨਹੀਂ ਹੈ!

ਇਨ੍ਹਾਂ ਵਿਸ਼ੇਸ਼ ਕਦਰਾਂ ਕੀਮਤਾਂ ਦੀ ਵਰਤੋਂ ਕਰਨ ਦਾ ਮਤਲਬ ਇਹ ਹੈ ਕਿ ਤੁਸੀਂ ਇੱਕ ਸਕ੍ਰੀਨਸ਼ਾਟ ਬਣਾ ਸਕਦੇ ਹੋ ਜੋ ਤੁਸੀਂ ਚਾਹੁੰਦੇ ਹੋ ਤਾਂ ਪੂਰੇ ਵੈੱਬ ਪੇਜ ਦਾ ਇੱਕ ਪੂਰਾ ਪੈਮਾਨਾ ਵਰਜ਼ਨ ਹੈ!

ਪੇਜ ਐਲੀਮੈਂਟ ਦਾ ਸਕ੍ਰੀਨ ਸ਼ਾਟ ਲਓ

ਗਰੈਬਜ਼ਿਟ ਤੁਹਾਨੂੰ ਐਚਟੀਐਮਐਲ ਐਲੀਮੈਂਟ ਦਾ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਣ ਦੀ ਆਗਿਆ ਦਿੰਦਾ ਹੈ, ਜਿਵੇਂ ਕਿ div or span ਇਸ ਦੀ ਸਾਰੀ ਸਮੱਗਰੀ ਨੂੰ ਟੈਗ ਅਤੇ ਕੈਪਚਰ ਕਰੋ. ਇਹ ਕਰਨ ਲਈ, HTML ਐਲੀਮੈਂਟ ਜਿਸ ਦਾ ਤੁਸੀਂ ਸਕਰੀਨ ਸ਼ਾਟ ਲੈਣਾ ਚਾਹੁੰਦੇ ਹੋ, ਇੱਕ ਦੇ ਤੌਰ ਤੇ ਨਿਰਧਾਰਤ ਕੀਤਾ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ CSS ਚੋਣਕਾਰ.

...
<div id="features">
	<img src="http://www.example.com/boat.jpg"/><h3>New Boat Launched</h3>
</div>
...

ਹੇਠਾਂ ਦਿੱਤੀ ਉਦਾਹਰਣ ਲਈ ਅਸੀਂ ਆਈਡੀ "ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ" ਨਾਲ ਡਿਵ ਦੀ ਚੋਣ ਕਰਾਂਗੇ ਅਤੇ ਇਸਨੂੰ 250 x 250px JPEG ਚਿੱਤਰ ਦੇ ਰੂਪ ਵਿੱਚ ਆਉਟਪੁੱਟ ਕਰਾਂਗੇ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

// The 250 parameters indicates that image should be sized to 250 x 250 px
var options = {"width":250, "height":250, "format":"jpg","target":"#features"};

client.url_to_image("http://www.bbc.co.uk/news", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});

ਅਗਲੀ ਉਦਾਹਰਣ "ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ" ਡਿਵ ਦਾ ਇੱਕ ਹੋਰ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲੈਂਦੀ ਹੈ ਪਰ ਇਸ ਵਾਰ ਇੱਕ ਜੇਪੀਈਜੀ ਚਿੱਤਰ ਨੂੰ ਬਾਹਰ ਕਰ ਦਿੰਦਾ ਹੈ ਜੋ ਕਿ ਦਿਵ ਦਾ ਸਹੀ ਅਕਾਰ ਹੈ.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

// The minus ones indicates that image should not be cropped
var options = {"browserHeight":-1, "width":-1, "height":-1, "format":"jpg", "target":"#features"};

client.url_to_image("http://www.bbc.co.uk/news", options);
//Then call the save or save_to method
client.save_to("result.jpg", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});