Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { firefox } = require('playwright');
- (async () => {
- // Launch Firefox browser in headless mode
- const browser = await firefox.launch({ headless: true });
- // Open a new page
- const page = await browser.newPage();
- // Navigate to target URL and wait until network idle
- await page.goto('https://www.example.com', { waitUntil: 'networkidle' });
- // Get the text content of the page
- const textContent = await page.evaluate(() => document.body.textContent);
- console.log(textContent);
- await browser.close();
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement