Questions about grabbing shadow-root

Background of the problem:

I use a web plugin that loads information such as the web product's shelf time, and when I try to use webscraper to grab both the product information and the plugin information at the same time, I encountered a problem

Issue:

1When I try to use webscraper's selector to select the plugin information, I get this selector:
. _xebgCWOx:shadow-root span.value[title]
This seems to work, but when formally crawling I found that _xebgCWOx is a dynamically loaded container name that changes every time I crawl, causing the crawl to fail

Scrap Url:

The plugins I use:


Sitemap:
{"_id":"temuTest","startUrl":["https://www.temu.com/search_result.html?search_key=%E7%89%99%E5%88%B7&search_method=user"],"selectors":[{"id":"search","parentSelectors":["_root"],"type":"SelectorElementAttribute","selector":"input._7H3Q1N2_","multiple":false,"extractAttribute":"value"},{"id":"block","parentSelectors":["_root"],"type":"SelectorElement","selector":"div.EKDT7a3v","multiple":true},{"id":"link","parentSelectors":["block"],"type":"SelectorLink","selector":"a","multiple":false,"linkType":"linkFromHref"},{"id":"image","parentSelectors":["block"],"type":"SelectorImage","selector":"img._3frBeExI","multiple":false},{"id":"name","parentSelectors":["block"],"type":"SelectorText","selector":"h2","multiple":false,"regex":""},{"id":"tag","parentSelectors":["block"],"type":"SelectorText","selector":"div._2rUIJIcl","multiple":false,"regex":""},{"id":"price","parentSelectors":["block"],"type":"SelectorText","selector":"div._382YgpSF","multiple":false,"regex":""},{"id":"sold","parentSelectors":["block"],"type":"SelectorText","selector":"span._3vfo0XTx:nth-of-type(1)","multiple":false,"regex":""},{"id":"up_time","parentSelectors":["block"],"type":"SelectorElement","selector":"div.Ois68FAW","multiple":false},{"id":"SalesVolume","parentSelectors":["block"],"type":"SelectorText","selector":"._NHzE7VRP:shadow-root div:nth-of-type(3) div","multiple":true,"regex":""},{"id":"categorization","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root span.value[title]","multiple":false,"regex":""},{"id":"Sotcks","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root div:nth-of-type(3) div:nth-of-type(6) span.value","multiple":false,"regex":""},{"id":"Assess","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root div:nth-of-type(3) div:nth-of-type(7) span.value","multiple":false,"regex":""},{"id":"StoreName","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root .value .link span","multiple":false,"regex":""},{"id":"StoreOpen","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root div:nth-of-type(5) div:nth-of-type(3) span.value","multiple":false,"regex":""},{"id":"StoreSell","parentSelectors":["block"],"type":"SelectorText","selector":"._xebgCWOx:shadow-root div:nth-of-type(5) div:nth-of-type(5) span.value","multiple":false,"regex":""},{"id":"111","parentSelectors":["up_time"],"type":"SelectorText","selector":"span.item","multiple":false,"regex":""},{"id":"1111","parentSelectors":["up_time"],"type":"SelectorText","selector":".data-v-3d26b3ee","multiple":false,"regex":""}]}

Hi,

What happens if you try the selector value:

[data-tooltip*='goodContainer-'] + div:shadow-root span.value[title]
1 Like

Thank you very much, this is recognizable.
I'm rather lacking in front-end skills and didn't manage to do it by example, but I fine-tuned it based on the selector you provided, and

[data-tooltip*='goodContainer-'] + div:shadow-root .content-item

grabs the desired more data

1 Like