Advertisement
dereksir

Untitled

Aug 30th, 2023 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { chromium } = require('playwright-extra');
  2.  
  3. chromium.launch({ headless: true }).then(async browser => {
  4.   const page = await browser.newPage()
  5.  
  6.   // Navigate to target URL
  7.   await page.goto('https://www.example.com');
  8.   // Get page HTML
  9.   const textContent = await page.evaluate(() => document.body.textContent);
  10.  
  11.   await browser.close()
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement