Let’s say I’m trying to scrape some category labels of different blog posts and save them individually to a CSV line.
Each blog post might have one to five categories stored individually in this element:
So, to find each category value I can add increments to this Xpath like this:
However, if a given blog post only has one category, this means that ui.vision will waste quite a bit of time searching for the other four categories that don’t exist and also return several #LNF values in my CSV file.
Is there a way to tell ui.vision something like:
“If //article/a isn’t found, don’t bother looking for //article/a, //article/a, etc. Just skip to the next part of the scraping process. Also, don’t log #LNF for any category you couldn’t find.”
I’m guessing there are probably a few ways to do this, so I appreciate any workarounds the community here can offer.