Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try the below code snippet using HtmlAgilityPack</p> <pre><code>var source = @"&lt;p&gt;&lt;a href=""http://in.news.yahoo.com/googles-stock-split-raises-questions-023232813.html""&gt;&lt;img src=""http://l.yimg.com/bt/api/res/1.2/TRLtYhdbTvFcX_GOU_0S4g--/YXBwaWQ9eW5ld3M7Zmk9ZmlsbDtoPTg2O3E9ODU7dz0xMzA-/http://media.zenfs.com/en_us/News/Reuters/2012-04-14T023232Z_5_CBRE83B1MAL00_RTROPTP_2_USA.JPG"" width=""130"" height=""86"" alt=""People visit Google's stand at the National Retail Federation Annual Convention and Expo in New York"" align=""left"" title=""People visit Google's stand at the National Retail Federation Annual Convention and Expo in New York"" border=""0"" /&gt;&lt;/a&gt;(Reuters) - An unusual stock split designed to preserve Google Inc founders' control of the Web search leader raised questions and some grumbling on Wall Street, even as investors focused on the company's short-term business concerns. Shares of Google closed 4 percent lower at $624.60 on Friday, driven by deepening worries about its search ad rates and payments to partners. The declining search trends underscored investor uncertainty about Google's growth prospects and unease about the company's pending $12.5 billion acquisition of Motorola Mobility. ...&lt;/p&gt;&lt;br clear=""all""/&gt;"; HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(source); var paraNode = doc.DocumentNode.SelectSingleNode("//p"); var desc = paraNode.InnerText; var anchorNode = doc.DocumentNode.SelectSingleNode("//p/a"); var link = anchorNode.GetAttributeValue("href", null); var imgNode = doc.DocumentNode.SelectSingleNode("//p/a/img"); var src = imgNode.GetAttributeValue("src", null); </code></pre> <p>There are many ways to do this, but this is just one of the approach to get the job done. It gives you an idea how to do it with <code>HtmlAgilityPack</code>. <code>XPATH</code> will give you lot of power while parsing stuff like this.</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