N
N
new-profile-web2018-12-12 06:50:37
Parsing
new-profile-web, 2018-12-12 06:50:37

How to extract data using XPath, with dynamic values?

There is a specific example that has >1000 product pages, each product can have 1-4 positions.
After analyzing each page, I found a paper clip //*[@id="LETUR-SkuListDeliveryAvailabilityInfo-1"]/div[2]/div[2]/div/a[2]
In this case: 1 is a product variable, /div [2] the place where the position is indicated, of course, if there are 4 positions, then /div[2] 4 pcs.
You need to go through all the products and get all the positions, how to provide this to the program so that it understands the variable and tries all possible options [0-9]*?
Working with SEO Spider Tool (sf)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
levedun, 2018-12-13
@levedun

"Clip" .. sorry, of course, I'm not so long in the subject. Is that what it's called right? In any case, I do not claim that my knowledge is correct enough. I would be happy to hear a comment on this. In any case, if it is a regular expression, then use the ending /g /gm. And to check the regular seasons, I recommend the service https://regex101.com/. I apologize in advance if I answered not quite on the topic and upset you, but it was difficult for my brain to delve into the problem, having studied your description, it somehow got into the essence instantly .., maybe it was not interested in it ... and I had to write this . Good luck !

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question