Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk2 min

Puppeteer में scroll के बाद load होने वाले web page sections कैसे capture करें

Puppeteer में scroll-triggered content capture करने के लिए site-specific readiness condition जांचें, फिर पूरे पेज या चुने हुए element का screenshot लें।
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Puppeteer में पहले पेज को scroll करके उसकी lazy-loaded सामग्री आने दें, फिर उस सामग्री के तैयार होने की पुष्टि करें और उसके बाद screenshot लें। page.evaluate() से नियंत्रित scroll, page.waitForFunction() से पेज-विशिष्ट readiness check, और आखिर में page.screenshot() या ElementHandle.screenshot() इस काम का व्यावहारिक क्रम है।

सही तरीका: scroll करें, नया content जांचें, फिर capture लें

सिर्फ fullPage: true देने से यह सुनिश्चित नहीं होता कि scroll पर आने वाली सामग्री लोड भी हो गई है। Screenshot से पहले ऐसा संकेत चुनें जो बताता हो कि जरूरी section या data तैयार है—जैसे किसी नए section का दिखना, content की गिनती बढ़ना, या loading indicator का हटना। संकेत वेबसाइट के अनुसार बदलता है; Puppeteer कोई एक सार्वभौमिक lazy-load recipe निर्धारित नहीं करता।

Puppeteer के आधिकारिक दस्तावेज़ Page.screenshot() और element screenshot के लिए ElementHandle.screenshot() बताते हैं। page.evaluate() में चलाया गया function page context में execute होता है; वह Promise लौटाए तो Puppeteer उसके resolve होने तक प्रतीक्षा करता है। page.waitForFunction() किसी function के truthy होने तक प्रतीक्षा कर सकता है।

पूरे पेज के लिए runnable उदाहरण

नीचे का उदाहरण उन पेजों के लिए है जहां scroll करने पर .content-section elements जुड़ते हैं। उस selector और readiness condition को अपने target page के वास्तविक markup के अनुसार बदलें। उदाहरण नए sections की संख्या बढ़ने की प्रतीक्षा करता है और अधिकतम scroll प्रयासों की सीमा रखता है, ताकि infinite-scroll पेज पर loop अनंत न चले।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
  • [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
  • [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
  • [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
  • [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({ headless: true });
  const page = await browser.newPage();

  try {
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });

    const selector = '.content-section';
    const maxScrolls = 20;
    let previousCount = await page.locator(selector).count();
    let previousHeight = await page.evaluate(() => document.documentElement.scrollHeight);
    let stableAtBottom = 0;

    for (let attempt = 0; attempt < maxScrolls; attempt++) {
      await page.evaluate(() => {
        window.scrollBy(0, Math.floor(window.innerHeight * 0.8));
      });

      // पहले जांचें कि नया section आया या नहीं।
      try {
        await page.waitForFunction(
          (sel, count) => document.querySelectorAll(sel).length > count,
          { timeout: 5000 },
          selector,
          previousCount
        );
      } catch {
        // हर scroll पर नया section आना जरूरी नहीं; नीचे height/position जांचें।
      }

      const currentCount = await page.locator(selector).count();
      const state = await page.evaluate(() => ({
        height: document.documentElement.scrollHeight,
        atBottom: window.scrollY + window.innerHeight >= document.documentElement.scrollHeight - 2
      }));

      if (currentCount > previousCount) {
        previousCount = currentCount;
        stableAtBottom = 0;
      } else if (state.height === previousHeight && state.atBottom) {
        stableAtBottom++;
      } else {
        stableAtBottom = 0;
      }

      previousHeight = state.height;
      if (stableAtBottom >= 2) break;
    }

    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

इसे चलाने के लिए Puppeteer अपने Node.js प्रोजेक्ट में install होना चाहिए। https://example.com और .content-section को वास्तविक URL और selector से बदलें। अगर पेज section जोड़ने के बजाय पहले से मौजूद section में text या attributes बदलता है, तो count की जगह उसी बदलाव की जांच करें। उदाहरण में 5 सेकंड का condition-wait प्रति प्रयास की सीमा है, किसी साइट की readiness की गारंटी नहीं।

Condition को पेज के अनुरूप बनाएं

  • किसी खास section के लिए selector की मौजूदगी जांचें। यदि वह पहले से मौजूद है, तो नया content, visibility या loading-state परिवर्तन जांचें।
  • कई items के लिए count को पिछली गिनती से तुलना करें, ताकि पहले से मौजूद content को नया समझने की गलती न हो।
  • यदि साइट loading indicator दिखाती है, तो उसके हटने के साथ अपेक्षित content आने की भी पुष्टि करें।
  • पेज की ऊंचाई बढ़ना उपयोगी सहायक संकेत है, लेकिन यह अपने आप में उस खास सामग्री के तैयार होने का प्रमाण नहीं है।

Scroll करने के तरीके और प्रतीक्षा के विकल्प

Page context में scroll

page.evaluate() से window.scrollBy() चलाना सरल और नियंत्रित तरीका है। Async evaluate function में चाहें तो scroll के बीच छोटी प्रतीक्षा रख सकते हैं; फिर भी capture से पहले वास्तविक readiness condition जांचें।

Rank #2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • Model: Dell OptiPlex 7050 Small Form Factor (SFF)
  • Processor: Intel Core i7-7700 3.60 GHz
  • Memory: 32GB DDR4 Ram
  • Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
  • Operating System: Windows 11 Pro (64-bit)

Locator के जरिए element तक जाना

जब अगला section ज्ञात हो, Puppeteer के locator API से उसे चुनकर उसके साथ interaction या scroll करना उपयोगी हो सकता है। Puppeteer की page interactions guide locators, scrolling और interaction से पहले की जांच समझाती है। Element तक पहुंच जाना यह साबित नहीं करता कि उसकी lazy-loaded सामग्री तैयार है—उसके लिए अलग condition रखें।

Network idle को अकेला संकेत न मानें

page.waitForNetworkIdle() उपलब्ध है, लेकिन network quiet होना यह नहीं बताता कि इच्छित visual content render हो चुका है। इसे तभी सहायक संकेत मानें जब उस साइट का व्यवहार इसकी अनुमति देता हो; section या data की readiness के लिए condition-based wait अधिक प्रत्यक्ष है।

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
  • POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
  • GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
  • ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
  • ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.

पूरे पेज या सिर्फ एक section का screenshot

लक्ष्य API कब चुनें
पूरा document page.screenshot({ path: 'page.png', fullPage: true }) जब deliverable में पूरी page लंबाई चाहिए।
एक ज्ञात element elementHandle.screenshot({ path: 'section.png' }) जब केवल किसी खास section को अलग image में चाहिए।

ElementHandle.screenshot() छिपे हुए element को screenshot से पहले view में लाने की कोशिश करता है। इससे उस element की lazy-loaded सामग्री तैयार होने की पुष्टि नहीं होती; पहले readiness condition पूरी करें।

एक section capture करने का उदाहरण

const section = await page.waitForSelector('.target-section', { visible: true });
await page.waitForFunction(() => {
  const el = document.querySelector('.target-section');
  return el && el.querySelectorAll('.loaded-item').length > 0;
});
await section.screenshot({ path: 'section.png' });

यहां .target-section और .loaded-item केवल उदाहरण selectors हैं। यदि content आने के बाद कोई स्पष्ट child element नहीं जुड़ता, तो condition को उस साइट के वास्तविक completion संकेत के मुताबिक बदलें।

Rank #4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
  • Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
  • Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
  • Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
  • Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

आम समस्याएं और उनके समाधान

  • Screenshot में नीचे का content नहीं है: पुष्टि करें कि scroll सच में lazy-load trigger करता है; फिर देखें कि wait predicate नया content पहचानता है, न कि केवल पहले से मौजूद पहला section।
  • Wait तुरंत सफल हो जाता है: condition शायद content की पहले से मौजूद स्थिति जांच रही है। पिछली count या किसी ऐसे state से तुलना करें जो scroll के बाद बदलना चाहिए।
  • Wait timeout होता है: selector गलत हो सकता है, section अभी scroll-triggered नहीं हुआ, या चुना गया संकेत उस साइट पर बदलता ही नहीं। Browser में वास्तविक DOM और loading behavior देखकर predicate सुधारें; timeout बढ़ाना अपने आप में समाधान नहीं है।
  • Network idle के बाद भी content अधूरा है: network idle को अकेला completion signal न बनाएं; अपेक्षित element, data count या loading state की जांच करें।
  • Infinite scroll कभी खत्म नहीं होता: अधिकतम प्रयास तय करें और साथ में no-growth/at-bottom जैसी exit condition रखें। केवल ऊंचाई स्थिर होना पर्याप्त नहीं हो सकता, इसलिए साइट का वास्तविक completion संकेत बेहतर है।
  • Element screenshot खाली या पुराना है: screenshot से पहले element की visibility और उसके भीतर अपेक्षित content की readiness जांचें। Element का अपने आप view में scroll होना content-loading की गारंटी नहीं है।

Or skip the browser setup

अपनी Puppeteer setup और site-specific scroll logic के बजाय ScreenshotNeo API को एक GET request में URL देकर screenshot या PDF लें। ScreenshotNeo cookie/consent banners स्वीकार कर 60 से अधिक ज्ञात consent platforms, newsletter popups और chat widgets हटाता है; हर चरण बंद किया जा सकता है। Bot checks/CAPTCHAs, blank pages, timeouts, failed loads और cache hits पर शुल्क नहीं लगता, और response में X-Page-Verdict तथा X-Billed headers बताते हैं कि क्या हुआ। इसका MCP server AI agents को screenshots लेने देता है। Free plan में बिना card 1,000 screenshots/month हैं; paid plans $5 में 3,000 से शुरू होते हैं। यह Puppeteer के custom scroll/readiness logic का स्वतः विकल्प नहीं है—विशिष्ट lazy-loaded section के लिए API के उपलब्ध capture विकल्प और उस page का व्यवहार जांचें।

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

API parameters और विकल्पों के लिए ScreenshotNeo documentation देखें। निःशुल्क खाता बनाने के लिए ScreenshotNeo पर साइन अप करें—1,000 screenshots/month बिना card के।

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

Quick Recap

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$399.99
Bestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.; Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
$179.98
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$255.00
Best Value
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
  • Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
  • Storage: Combines 500GB SSD and 1TB HDD for ample storage space
  • Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
  • Design: Sleek desktop tower with black color and slim profile for modern look

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.