c# - How to access nested div based on class name -


i have html code:

<div class="searchresult webresult">    <div class="resulttitlepane">     google   </div>    <div class="resultdisplayurlpane">     www.google.com     </div>   <div class="resultdescription">    search  </div> </div> 

i want access innertext inside divs in diffrent variables
know accessing div class hould write

var titles = hd.documentnode.selectnodes("//div[@class='searchresult webresult']");   foreach (htmlnode node in titles)     {?} 

what code should write innertext of each dive in different variables.tnx

i extend current xpath expression have match inner div elements:

//div[@class='searchresult webresult']/div[contains(@class, 'result')] 

then, text, use .innertext property:


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -