puppeteer-jquery
puppeteer-jquery copied to clipboard
Clicking a Dynamic Element
Hi how do you click an element added dynamically to the page? For example, if an element is added via JavaScript after the page is loaded the code page.jQuery(selector).trigger("click") doesn't find the element and results in an error.
page.jQuery(selector).trigger("click")
just emit a click event and is, far from a real click, and they work for dynamique elements.
Puppeteer and Playwright click functions should be used by default and should work with a dynamic element.
I'm using my own automation framework now, puppeteer-jquery is the first step to migrating to Playwright.
page.jQuery(selector).trigger("click")
Is the above code supposed to work then on dynamic elements @UrielCh ? When I'm trying this code it only works on static objects (i.e. part of the DOM at page render time).
ok, provide a full sample. I will test is / fix it and add it as a sample.