mardi 31 mars 2015

Importxml on attribute

I'm trying to scrape the following content attributes from this site using a googlesheet. Unfortunately every variation i can think of seems to fail



<span itemprop="aggregateRating" itemscope="" itemtype="http://ift.tt/GXOCyu">
<span itemprop="ratingValue" content="3.5"></span>
<span itemprop="ratingCount" content="12"></span>
<span itemprop="reviewCount" content="12"></span>
</span>


I'm looking to extract the values 3.5, 12 & 12 using



=importxml(A2,//*[@id='topOnProduct']/div[2]/span/span[1])
=importxml(A2,//*[@id='topOnProduct']/div[2]/span/span[1]@content)
=importxml(A2,"//span[@itemprop='ratingValue']/@content")


and about 50 other variations on the respective attributes - i'm also having no joy using kiimono. Can anyone advise me where i'm going wrong/show me how to achieve this


Aucun commentaire:

Enregistrer un commentaire