Note that there are some explanatory texts on larger screens.

plurals
  1. POPulling price from amazon rss feed embedded in description
    text
    copied!<p>I am working on an RSS feed, which is pulling data from an Amazon RSS feed of books. I am using C# .NET Compact Framework 3.5. I can get the title of the book, the date published etc from the nodes in the RSS feed. However, the price of the book is embedded in a whole heap of HTML in the description node. How would I go about extracting only the price and not a load of HTML? </p> <pre><code>if (nodeChannel.ChildNodes[i].Name == "item") { nodeItem = nodeChannel.ChildNodes[i]; row = new ListViewItem(); row.Text = nodeItem["title"].InnerText; row.SubItems.Add(nodeItem["description"].InnerText); listBooks.Items.Add(row); } </code></pre> <p>An example of the price in the middle of the description node</p> <pre><code>&lt;description&gt;&lt;![CDATA[ &lt;div class="hreview" style="clear:both;"&gt; &lt;div class="item"&gt; &lt;div style="float:left;" class="tgRssImage"&gt;&lt;a class="url" href="http://rads.stackoverflow.com/amzn/click/B0013FDM7E"&gt;&lt;img src="http://ecx.images-amazon.com/images/I/51MvRlzFlpL._SL160_SS160_.jpg" width="160" alt="I Am Legend (Widescreen Single-Disc Edition)" class="photo" height="160" border="0" /&gt;&lt;/a&gt;&lt;/div&gt; &lt;span class="tgRssTitle fn summary"&gt;I Am Legend (Widescreen Single-Disc Edition) (&lt;span class="tgRssBinding"&gt;DVD&lt;/span&gt;)&lt;br /&gt;By &lt;span class="tgRssAuthor"&gt;Will Smith&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="description"&gt; &lt;br /&gt; &lt;span style="display: block;" class="tgRssPriceBlock"&gt;&lt;span class="tgProductPriceLine"&gt;&lt;a href="http://rads.stackoverflow.com/amzn/click/B0013FDM7E"&gt;Buy new&lt;/a&gt;: &lt;span class="tgProductPrice"&gt;$5.49&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="tgProductUsedPrice"&gt;&lt;a href="http://rads.stackoverflow.com/amzn/click/B0013FDM7E" id="tag_rso_rs_eofr_used"&gt;285 used and new&lt;/a&gt; from &lt;span class="tgProductPrice"&gt;$1.00&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;span class="tgRssReviews"&gt;Customer Rating: &lt;img src="http://g-ecx.images-amazon.com/images/G/01/x-locale/common/customer-reviews/stars-3-5._V192240731_.gif" width="64" alt="3.6" align="absbottom" height="12" border="0" /&gt;&lt;br /&gt;&lt;/span&gt; &lt;br /&gt; &lt;span class="tgRssProductTag"&gt;&lt;/span&gt; &lt;span class="tgRssAllTags"&gt;Customer tags: &lt;a href="http://www.amazon.com/tag/science%20fiction/ref=tag_rss_rs_itdp_item_at"&gt;science fiction&lt;/a&gt;(92), &lt;a href="http://www.amazon.com/tag/will%20smith/ref=tag_rss_rs_itdp_item_at"&gt;will smith&lt;/a&gt;(79), &lt;a href="http://www.amazon.com/tag/horror/ref=tag_rss_rs_itdp_item_at"&gt;horror&lt;/a&gt;(51), &lt;a href="http://www.amazon.com/tag/action/ref=tag_rss_rs_itdp_item_at"&gt;action&lt;/a&gt;(43), &lt;a href="http://www.amazon.com/tag/adventure/ref=tag_rss_rs_itdp_item_at"&gt;adventure&lt;/a&gt;(34), &lt;a href="http://www.amazon.com/tag/fantasy/ref=tag_rss_rs_itdp_item_at"&gt;fantasy&lt;/a&gt;(33), &lt;a href="http://www.amazon.com/tag/dvd/ref=tag_rss_rs_itdp_item_at"&gt;dvd&lt;/a&gt;(30), &lt;a href="http://www.amazon.com/tag/movie/ref=tag_rss_rs_itdp_item_at"&gt;movie&lt;/a&gt;(20), &lt;a href="http://www.amazon.com/tag/zombies/ref=tag_rss_rs_itdp_item_at"&gt;zombies&lt;/a&gt;(14), &lt;a href="http://www.amazon.com/tag/i%20am%20legend/ref=tag_rss_rs_itdp_item_at"&gt;i am legend&lt;/a&gt;(6), &lt;a href="http://www.amazon.com/tag/bad%20sci-fi/ref=tag_rss_rs_itdp_item_at"&gt;bad sci-fi&lt;/a&gt;(4), &lt;a href="http://www.amazon.com/tag/mutants/ref=tag_rss_rs_itdp_item_at"&gt;mutants&lt;/a&gt;(4)&lt;br /&gt;&lt;/span&gt; &lt;/div&gt;&lt;/div&gt;]]&gt;&lt;/description&gt; </code></pre> <p>$5.49 is in that mess somewhere</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload