This is what I want to parse
<div class="photoBox pB-ms">
<a href="/user_details?userid=ePDZ9HuMGWR7vs3kLfj3Gg">
<img width="100" height="100" alt="Photo of Debbie K." src="http://s3-media2.px.yelpcdn.com/photo/xZab5rpdueTCJJuUiBlauA/ms.jpg">
</a>
</div>
I am using following XPath to find it
HtmlNodeCollection bodyNode = htmlDoc.DocumentNode.SelectNodes("//div[@class='photoBox pB-ms']");
This is fine and return,s me all div,s with photobox class
But when I want to get ahref using
HtmlNodeCollection bodyNode = htmlDoc.DocumentNode.SelectNodes("//div[@class='photoBox pB-ms'//a href]");
I got error invalid token.
Also I tried using query
var lowestreview =
from main in htmlDoc.DocumentNode.SelectNodes("//div[@class='photoBox pB-ms']")
from rating in main.SelectNodes("//a href")
select new { Main=main.Attributes[0].Value,AHref = rating.ToString() };
Will anybody tell me how to write XPath or query to get this AHref