Advertisement
dereksir

Untitled

Aug 30th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //..
  2.  
  3. (async () => {
  4.     //..
  5.    
  6.     console.log('Taking a screenshot...');
  7.  
  8.     // Navigate to target URL and wait until network idle
  9.     await page.goto('https://www.example.com', { waitUntil: 'networkidle' });
  10.  
  11.     // Take a screenshot and save to screenshot.png
  12.     await page.screenshot({ path: 'screenshot.png', fullPage: true });
  13.    
  14.     console.log('Screenshot saved as screenshot.png');
  15.     await browser.close();
  16. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement