Closed schardev closed 2 years ago
This package just calls Puppeteer APIs underneath, so either you're using the incorrect selector or Puppeteer does not support shadow root selectors in their APIs.
https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitforselectorselector-options
Thanks for the quick response. So it turns out Puppeteer's selector
interface does support pierce
-ing through the shadow root, we just have to use a custom selector with a custom handler (which, for this task, is already provided by Puppeteer), so we can select a shadow dom element by using the following as a selector: pierce/<you-regular-selector>
Ref: https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#interface-selector
Closing this as the issue has been solved.
I tried capturing an element inside the root shadow element but it always times out. I did try
waitForElement
anddelay
but still the same. So, is there a any possible way to capture elements of a shadow DOM?