const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless:false});
const page = await browser.newPage();
await page.goto('https://www.ozon.ru/', {waitUntil: 'load'});
await page.screenshot({path: 'test1.png'});
await page.waitForSelector('.f9j5');
await page.click('.f9j5');
await page.waitForTimeout(2000);
await page.keyboard.type("Санки", {delay: 100});
await page.click('button.f9k');
await page.screenshot({path: 'test2.png'});
await page.waitForSelector('.ui-b3.ui-c.ui-b5.ui-f3');
const text = await page.evaluate(() => {
const anchor = document.querySelector('.ui-b3.ui-c.ui-b5.ui-f3');
return anchor.textContent;
});
console.log(text);
await page.screenshot({path: 'test3.png'});
await browser.close();
})();