કેટલાક વેબપૃષ્ઠોને લોડ થવામાં થોડો સમય લાગી શકે છે અથવા તમે જે વિશિષ્ટ સામગ્રી ધરાવો છો intમુખ્ય પૃષ્ઠ લોડ થયા પછી લોડ થઈ શકે છે. આ ખાસ કરીને AJAX ભારે વેબ પૃષ્ઠો પર સાચું છે જ્યાં સામગ્રી જાવાસ્ક્રિપ્ટ દ્વારા લોડ કરવામાં આવે છે.
જ્યારે વેબપેજ લોડ થાય છે ત્યારે GrabzIt શોધે છે પરંતુ ઉપર સૂચિબદ્ધ કેટલાક ચોક્કસ સંજોગો માટે તેને વિલંબના સ્વરૂપમાં કેટલીક વધારાની સૂચનાઓની જરૂર છે જેનો ઉપયોગ કેપ્ચર લેવામાં આવે તે પહેલાં અથવા કેપ્ચર થાય તે પહેલાં સ્પષ્ટ HTML ઘટક દેખાય તેની રાહ જોઈને થવો જોઈએ. આગળ જો તમે વેબ પેજના સ્ક્રીનશોટ લઈ રહ્યા હોવ અથવા HTML કન્વર્ટ કરી રહ્યા હોવ તો આ તકનીકોનો ઉપયોગ કરી શકાય છે into PDF, ઇમેજ અથવા વર્ડ દસ્તાવેજો, અને તમારી પાસે પ્રીમિયમ પેકેજ છે. જો કે બંને તકનીકો ત્રીસ સેકન્ડના મહત્તમ રાહ સમય સુધી મર્યાદિત છે.
ખૂબ મોટા વિલંબનો ઉપયોગ ન કરવો એ એક સારો વિચાર છે કારણ કે કૅપ્ચર કતારમાં હોય તેવી અસામાન્ય ઘટનામાં મોટો વિલંબ કૅપ્ચરની અગ્રતા ઘટાડશે, જો કે ત્યાં કેટલાક હોંશિયાર કામ આસપાસ અહીં સુધી.
આ સુવિધાઓ અમારામાં પણ ઉપલબ્ધ છે ઑનલાઇન સ્ક્રીનશોટ અને વેબ સ્ક્રેપર સાધનો.
ફક્ત મિલિસેકંડમાં વિલંબનો ઉલ્લેખ કરો અને આ કેપ્ચર કેટલો સમય રાહ જોશે તે છે. યાદ રાખો કે એક સેકન્ડમાં 1000 મિલીસેકન્ડ છે. નીચેના તમામ ઉદાહરણો વેબપેજને કેપ્ચર કરતા પહેલા ત્રણ સેકન્ડ રાહ જુઓ.
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); ImageOptions options = new ImageOptions(); options.Delay = 3000; grabzIt.URLToImage("http://www.spacex.com", options); grabzIt.SaveTo("images/result.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); ImageOptions options = new ImageOptions(); options.setDelay(3000); grabzIt.URLToImage("http://www.spacex.com", options); grabzIt.SaveTo("images/result.jpg");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com",
{"delay": 3000}).Create();
</script>
var grabzit = require('grabzit'); var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret"); var options = {"delay":"3000"}; client.url_to_image("http://www.spacex.com", options); client.save_to("images/result.jpg", function (error, id){ if (error != null){ throw error; } });
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = GrabzItImageOptions->new(); $options->delay(3000); $grabzIt->URLToImage("http://www.spacex.com", $options); $grabzIt->SaveTo("images/result.jpg");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = new \GrabzIt\GrabzItImageOptions(); $options->setDelay(3000); $grabzIt->URLToImage("http://www.spacex.com", $options); $grabzIt->SaveTo($filepath);
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzItImageOptions.GrabzItImageOptions() options.delay = 3000 grabzIt.URLToImage("http://www.spacex.com", options) grabzIt.SaveTo("images/result.jpg")
https://api.grabz.it/services/convert?key=Sign in to view your Application Key&format=jpg&delay=3000&url=https%3A%2F%2Fspacex.com%2F
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzIt::ImageOptions.new() options.delay = 3000 grabzItClient.url_to_image("http://www.spacex.com", options) grabzItClient.save_to("images/result.jpg")
આ તકનીક ખાસ કરીને વેબપેજ પર ઉપયોગી છે જે સામગ્રી લોડ કરવા માટે AJAX પદ્ધતિઓનો ઉપયોગ કરે છે. સૌપ્રથમ તમારા બ્રાઉઝર ડેવલપર ટૂલ્સનો ઉપયોગ કરીને તે તત્વને ઓળખો કે જેના માટે તમારે દેખાવાની રાહ જોવી પડશે, તેના id, વર્ગની નોંધ લો અથવા વધુ જટિલ CSS પસંદગીકાર બનાવો. પછી આ સ્પષ્ટ કરો સીએસએસ પસંદગીકાર અને એકવાર તત્વ દૃશ્યમાન થઈ જાય પછી વેબ પેજ કેપ્ચર થઈ જાય છે. નોંધ કરો કે જો ત્યાં એકથી વધુ મેળ ખાતા HTML ઘટકો હોય તો તે એક દૃશ્યમાન થતાં જ દેખાશે.
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); ImageOptions options = new ImageOptions(); options.WaitForElement = "#Content"; grabzIt.URLToImage("http://www.spacex.com", options); grabzIt.SaveTo("images/result.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); ImageOptions options = new ImageOptions(); options.setWaitForElement("#Content"); grabzIt.URLToImage("http://www.spacex.com", options); grabzIt.SaveTo("images/result.jpg");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com",
{"waitfor": "#Content"}).Create();
</script>
var grabzit = require('grabzit'); var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret"); var options = {"waitForElement":"#Content"}; client.url_to_image("http://www.spacex.com", options); client.save_to("images/result.jpg", function (error, id){ if (error != null){ throw error; } });
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = GrabzItImageOptions->new(); $options->waitForElement("#Content"); $grabzIt->URLToImage("http://www.spacex.com", $options); $grabzIt->SaveTo("images/result.jpg");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = new \GrabzIt\GrabzItImageOptions(); $options->setWaitForElement("#Content"); $grabzIt->URLToImage("http://www.spacex.com", $options); $grabzIt->SaveTo($filepath);
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzItImageOptions.GrabzItImageOptions() options.waitForElement = "#Content" grabzIt.URLToImage("http://www.spacex.com", options) grabzIt.SaveTo("images/result.jpg")
https://api.grabz.it/services/convert?key=Sign in to view your Application Key&format=jpg&waitfor=%23Content&url=https%3A%2F%2Fspacex.com%2F
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzIt::ImageOptions.new() options.waitForElement = "#Content" grabzItClient.url_to_image("http://www.spacex.com", options) grabzItClient.save_to("images/result.jpg")
આ તકનીકનો ઉપયોગ પહેલા ઉલ્લેખિત વિલંબ પદ્ધતિ સાથે કરી શકાય છે. તમને HTML ઘટક દેખાય ત્યાં સુધી રાહ જોવાની અને પછી કેપ્ચર બનાવતા પહેલા વધુ સમય માટે રાહ જોવાની મંજૂરી આપે છે.