Element selector cant target specific nodes

I cant select any elements on the following page, where ever i click it just selects "root", trying to move to the children doesn't seem to work either.

Url: SuttaCentral

Am I doing something wrong or is it something in that site? Thanks

@psilocybin Hello.

This issue appears because of the multiple "shadow-roots" this website contains.

To select the list of names for example, you should manually create a selector like this - sc-site-layout:shadow-root #page_selector:shadow-root sc-static-names:shadow-root dl > dt

Learn more: CSS selector | Web Scraper Documentation

Sitemap example:

{"_id":"suttacentral-net","startUrl":["https://suttacentral.net/names"],"selectors":[{"delay":0,"id":"name","multiple":true,"parentSelectors":["_root"],"regex":"","selector":"sc-site-layout:shadow-root #page_selector:shadow-root sc-static-names:shadow-root dl > dt","type":"SelectorText"}]}

Hope it helps!

1 Like

perfect, thank you! :pray:

@psilocybin You are welcome :wink:

Curious as why a web-developer might choose to use a shadow-root within their code? What function does is provide?

maybe cause it makes it harder for newbs to scrape? :grin:

@psilocybin @bretfeig Most likely it improves the loading pace & and the consistency of the website.