0
votes

I am stuck on a challenging import query from the following website

https://www.zara.com/tr/en/full-length-trousers-p07385169.html?v1=88239943&v2=1471790

The links shows a product by zara that has some size variations

for some reason they mark the out of stock variations as "disabled" in html. I am not sure how does that work.

my mission is to scrape the in stock variations. or all the variations but with a hint to the out of stock ones.

The =IMPORTXML(A1,("//span[@class='product-size-info__name']")) function returns all the variations without any note about the disabled ones.

is there is any way to get only the active variations? or all variations with any hint about the disabled ones?

Thanks in advance.

2

2 Answers

0
votes

The code for the item is this: <li class="product-size-.......product-detail-info-88239091-item-2" disabled>......

So you should try to select all items without disabled> at the end.

0
votes

You can use this path to avoid getting the disabled elements:

=IMPORTXML(A1,("//ul[@class='product-size-selector__size-list']/li[not(@disabled)]"))

This will get all the sizes available and avoid the others.