( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
import puppeteer from 'puppeteer';
(async () => {
// Launch Puppeteer's bundled Chromium with the necessary flags
const browser = await puppeteer.launch({
headless: true,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--no-crashpad' // Disable crashpad to avoid the error
],
});
const page = await browser.newPage();
await page.goto('https://developer.chrome.com/');
await page.setViewport({ width: 1080, height: 1024 });
await page.type('.devsite-search-field', 'automate beyond recorder');
const searchResultSelector = '.devsite-result-item-link';
await page.waitForSelector(searchResultSelector);
await page.click(searchResultSelector);
await page.waitForSelector('h1');
const fullTitle = await page.$eval('h1', el => el.textContent.trim());
console.log(`The title of this blog post is "${fullTitle}".`);
await browser.close();
})();