0

I am trying to extract raw data from the Apple product page, http://www.apple.com/sg/shop/browse/home/specialdeals/ipad

I can get all the body content fine except the price.

<td class="purchase-info">
        <p class="price">
        <span class="current_price">
            <span itemscope="itemscope" itemtype="http://schema.org/Offer" itemprop="offers">           
                <meta itemprop="priceCurrency" content="SGD">
                <span itemprop="price">
                    S$548.00
                </span>
            </span>
    </span>
</td>

Funny thing is, enlive is only able to parse out the below, sans the price data.

   {:attrs {:class "purchase-info"}
         :content ("\n                    "
                   {:attrs {:class "price"}
                    :content ("\n\t\n\t\t\n\t\n\t\n\t\n\t\n\t\n\t\t\n\t\t\t"
                              {:attrs {:class "current_price"}
                               :content ("\n\t\t\t\t\n\t\t\t\t\t"
                                         {:attrs {:itemprop "offers"
                                                  :itemscope "itemscope"
                                                  :itemtype "http://schema.org/Offer"}
                                          :content ("\n\t\t\t\t\t\n\n\t\t\t\t\t\t")
                                          :tag :span})
                               :tag :span})
                    :tag :p})
  :tag :td})

Am I missing something that cause the parser to ignore the sub-span data?

Teo Choong Ping
  • 12,512
  • 18
  • 64
  • 91
  • 2
    What version of enlive are you using, and how do you parse that snippet? It works fine for me with enlive 1.1.6. – Diego Basch Sep 14 '15 at 16:59
  • This does show me the price, `(enlive/select r2 [(enlive/attr= :itemprop "price")])` however if I try to select the price out from parsed out nodes in iteration, the above select returns empty (). – Teo Choong Ping Sep 14 '15 at 17:20

0 Answers0