Hello!
I’m setting up a data connector from a crawler and I’m struggling to use the XPath selector to isolate a bit of text. After much trial with XPath selectors, I can’t seem to only get the text “wantThis” because the XPath selector always includes “dontWantThis1” and “dontWantThis2”. Is there anyway to only select “wantThis”?
The XPath selector I’m currently using is: //ul[@class=“ingredients-list”]/li/label/span[@class=“ingredient-product-wrap”]
The difference is that the “Text” setting will extract all text contained within the element you specify, including the text of any of that element’s children (e.g. dontWantThis1, dontWantThis2 in addition to wantThis), whereas the “Direct Text” setting will only extract the text directly within the element you specified and not its children (e.g. just wantThis).