October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Chrome Headless में scroll के बाद load होने वाली images कैसे capture करें

Chrome Headless का --screenshot scroll नहीं करता। Puppeteer से scroll, lazy-image readiness checks और capture का व्यावहारिक तरीका जानें।
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Chrome Headless का सीधा --screenshot विकल्प पेज को scroll करके lazy-loaded images चालू नहीं करता। इसके लिए Puppeteer से पेज खोलें, उस पर scroll करें, images की readiness जाँचें और फिर screenshot लें। नीचे दिया JavaScript उदाहरण document को कई बार scan करता है, ताकि scroll से जुड़ा नया content भी आ सके।

सही तरीका: पहले scroll, फिर image readiness जाँच, उसके बाद screenshot

पेज का load event यह साबित नहीं करता कि हर image तैयार है। Lazy-loaded image viewport के पास आने पर ही load शुरू कर सकती है। इसलिए क्रम यह रखें: पेज खोलें, relevant हिस्सों तक scroll करें, images की स्थिति जाँचें और अंत में capture करें।

Chrome का command-line --screenshot सरल capture के लिए उपयोगी है, लेकिन उसका --timeout केवल capture से पहले प्रतीक्षा कराता है; वह पेज को scroll करने का निर्देश नहीं है। Scroll-triggered content के लिए Puppeteer जैसे browser automation layer का उपयोग करें।

Puppeteer से पूरी लंबी page capture करें

इंस्टॉल और चलाएँ

Node.js वाले folder में Puppeteer install करें:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
npm init -y
npm install puppeteer

नीचे के code को capture.js नाम से save करें। इसे चलाते समय target URL दें:

node capture.js https://example.com
const puppeteer = require('puppeteer');

const url = process.argv[2];
if (!url) {
  console.error('Usage: node capture.js https://example.com');
  process.exit(1);
}

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1365, height: 900, deviceScaleFactor: 1 });
    await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });

    // Scroll in viewport-sized increments. Repeat if scrolling appends more page.
    let previousHeight = 0;
    let stablePasses = 0;
    for (let pass = 0; pass < 8 && stablePasses < 2; pass++) {
      const height = await page.evaluate(() =>
        Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight || 0)
      );
      const step = Math.max(200, Math.floor(window.innerHeight * 0.75));

      for (let y = 0; y < height; y += step) {
        await page.evaluate(y => window.scrollTo(0, y), y);
        await sleep(250);
      }
      await page.evaluate(() => window.scrollTo(0, document.documentElement.scrollHeight));
      await sleep(500);

      const newHeight = await page.evaluate(() =>
        Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight || 0)
      );
      if (newHeight === previousHeight) stablePasses++;
      else stablePasses = 0;
      previousHeight = newHeight;
    }

    // Wait a bounded time for currently discovered <img> elements to finish.
    // complete can also be true for a failed image; naturalWidth distinguishes success.
    await page.waitForFunction(
      () => [...document.images].every(img => img.complete),
      { timeout: 10000 }
    ).catch(() => {});

    const imageReport = await page.evaluate(() => [...document.images].map(img => ({
      src: img.currentSrc || img.src,
      complete: img.complete,
      naturalWidth: img.naturalWidth
    })));
    const failed = imageReport.filter(img => !img.complete || img.naturalWidth === 0);
    if (failed.length) {
      console.warn(`${failed.length} image(s) may be missing or failed; see image-report.json`);
      require('fs').writeFileSync('image-report.json', JSON.stringify(failed, null, 2));
    }

    await page.screenshot({ path: 'page.png', fullPage: true });
    console.log(`Saved page.png; checked ${imageReport.length} img element(s).`);
  } finally {
    await browser.close();
  }
})().catch(error => {
  console.error(error);
  process.exitCode = 1;
});

यह एक adaptable pattern है, किसी खास वेबसाइट पर परीक्षण का दावा नहीं। 250 ms का pause और 8 passes उदाहरण के लिए सीमित मान हैं, सार्वभौमिक मान नहीं। धीमी साइट पर इन्हें बढ़ाएँ; अनंत scroll या लगातार बढ़ते पेज पर pass limit को सावधानी से समायोजित करें। Image report में naturalWidth: 0 वाली entries विफल या अभी अनुपलब्ध image हो सकती हैं।

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Image check का अर्थ

HTMLImageElement.complete बताता है कि image loading पूरी हुई है, लेकिन failed image भी complete हो सकती है। इसलिए सफल image के लिए naturalWidth > 0 भी जाँचें। इस उदाहरण में wait सीमित है ताकि कोई image अटकने पर script अनिश्चित समय तक न रुके।

Nested scroll container या viewport screenshots

जब पूरा document नहीं, कोई अंदर का panel scroll होता हो

कुछ साइटों में scrollable हिस्सा document नहीं, बल्कि कोई container होता है—जैसे .feed। ऐसे में window.scrollTo() उसे नहीं चलाएगा। DevTools में सही selector पहचानकर उस element का scrollTop बढ़ाएँ और उसी container के content तथा images की readiness जाँचें। Container के अपने scroll root पर निर्भर Intersection Observer lazy loading को trigger कर सकता है; केवल document scroll करने से वह जरूरी नहीं होगा।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

एक लंबी image या कई छोटे captures

जरूरत तरीका ध्यान देने योग्य बात
एक लंबी page image Scroll से content trigger और जाँच के बाद page.screenshot({ fullPage: true }) बहुत लंबे document में image बड़ी और memory/file आकार अधिक हो सकता है।
हर viewport का अलग capture हर scroll position पर संबंधित viewport की images तैयार होने के बाद सामान्य page.screenshot() Sticky या fixed UI हर capture में दोहर सकता है; तय करें कि यह अपेक्षित है या नहीं।

कौन सा output बेहतर है, यह इस पर निर्भर है कि आपको एक shareable tall artifact चाहिए या अलग-अलग viewport shots, और पेज scroll पर कितनी सामग्री जोड़ता है। Puppeteer page screenshot और element screenshot दोनों देता है। किसी एक element को capture करने के लिए selector से handle लें और उसका screenshot() चलाएँ; Puppeteer छिपे हुए target को screenshot से पहले view में लाने की कोशिश करता है।

Network idle मदद करता है, पर पर्याप्त प्रमाण नहीं

page.waitForNetworkIdle() network के quiet रहने की अवधि का इंतजार कर सकता है। Scroll के बाद यह उपयोगी अतिरिक्त pause है, लेकिन यह साबित नहीं करता कि मांगी गई हर image दिखाई दी या decode हो गई। कुछ पेज analytics या अन्य लगातार requests रखते हैं; कुछ resources cache से मिलते हैं। इसे bounded timeout के साथ उपयोग करें और वास्तविक target images भी जाँचें।

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

कौन-सी images इस तरीके से नहीं मिलेंगी?

  • Scroll से और content जुड़ता हो: document height फिर बढ़ सकती है। ऊपर का उदाहरण कई passes करता है; बहुत dynamic feed में अधिक passes या साइट-विशिष्ट termination condition चाहिए।
  • CSS background images: ये document.images में नहीं आतीं। संबंधित element की computed style और background asset के अनुसार अलग जाँच करें।
  • Canvas में बनी imagery: canvas pixels <img> element नहीं हैं; application के render completion संकेत का इंतजार करना पड़ेगा।
  • Failed या source-विहीन image: readiness wait को अनंत न रखें। complete और naturalWidth दोनों देखें और विफलताओं को report करें।
  • Lazy image का आकार शून्य: image के dimensions न होने पर lazy loading का व्यवहार प्रभावित हो सकता है; ऐसे पेज पर capture script से पहले page-side sizing समस्या समझें।
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

आम समस्याएँ और समाधान

लक्षण संभावित कारण क्या करें
Screenshot में नीचे की images खाली हैं Capture से पहले scroll ने lazy loader को trigger नहीं किया, या प्रतीक्षा कम रही। Scroll को छोटे increments में करें, संबंधित image की readiness जाँचें और आवश्यकता पर अतिरिक्त pass चलाएँ।
Script network-idle पर अटकती है पेज लगातार requests चला रहा है। Network-idle को timeout दें या छोड़ें; image-specific bounded check और report का उपयोग करें।
पूरी page की ऊँचाई अधूरी है Scroll पर नया content बाद में append हुआ। Scroll passes दोहराएँ और stable height की शर्त रखें; infinite feed के लिए स्पष्ट सीमा निर्धारित करें।
एक खास panel की images नहीं आतीं वास्तविक scroll root nested container है। Container को selector से target करके उसका scrollTop बदलें, फिर उसी क्षेत्र की जाँच करें।
Report में image failed दिखती है Network/resource failure, अनुपलब्ध source या site-side issue हो सकता है। Report का URL देखें; उस resource को सीधे browser में जाँचें और सफल dimensions के लिए naturalWidth > 0 आवश्यक मानें।

Or skip the browser setup

अगर अपना headless browser चलाने और scroll orchestration की जरूरत नहीं है, ScreenshotNeo का screenshot API एक GET request से capture देता है। इसका full-page विकल्प lazy images को load करने के लिए scroll करता है। Cookie/consent banners, newsletter popups और chat widgets capture से पहले हटाए जाते हैं; हर कदम बंद किया जा सकता है।

उदाहरण cURL request (API docs):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Bot checks/CAPTCHAs, blank pages, timeouts, failed loads और cache hits का शुल्क नहीं लगता; response के X-Page-Verdict और X-Billed headers बताते हैं कि क्या हुआ। AI agents के लिए MCP server में take_screenshot, get_page_info और capture_pdf tools हैं। Free plan में बिना card के 1,000 shots प्रति माह हैं; paid plans $5 में 3,000 से शुरू होते हैं।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

मुफ्त account बनाएं और 1,000 screenshots प्रति माह बिना card के शुरू करें।

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$24.99
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
SaleBestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$54.99
Best Value
Sale
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.