refactor: proper playwright usae

This commit is contained in:
karishmas6
2024-04-17 00:17:31 +05:30
parent b33e6fc508
commit dde1604011

View File

@@ -1,7 +1,9 @@
const { chromium } = require('playwright');
import playwright from 'playwright';
async function scraper(url, selectors) {
const browser = await chromium.launch();
const browser = await playwright.chromium.launch({
headless: false // setting this to true will not run the UI
});
const page = await browser.newPage();
try {