jeudi 17 septembre 2020

Looking for a child element within ElementHandle with waitFor

I have a specific listing that contains the lazy-loading calendar for each record. I catch them by

 docsPanels = await page. $$ ('[data-id = "result-item"]');

then I need to go to every element and check if the calendar actually loads for it. I need to check the calendar within the element I have from the list. Something like:

for (const panel of Object.values ​​(docsPanels)) {
            await panel.hover ({delay: 100});               // scroll to the record
            panel.waitForSelector ('.lazy-calendar-slot'); // checks the calendar within the element
        };

I wonder if there is anything like this, cause the ElementHandle.$ ('selector') which is the closest to my solution is working immediately. Any workaround, solution for it?

Aucun commentaire:

Enregistrer un commentaire