iphone - hpple html parse block by block or property by property? -


I'm new about hpple and xpath. For the HTML code below, I want to get both "title" and "tag" information.

From the example code of HP, I can get an array of titles and another array of tags. But if there are six properties, then I am interested, there are six arrays.

Can I find div [class = "entry"], then your child's, div [class = "meta"]? (Can anyone share the code?)

Thank you.

  & lt; Div class = "content" & gt; & Lt; Div id = "1" square = "entry" & gt; & Lt; H2 class = "title" & gt; Title for entry 1 & lt; / H2 & gt; & Lt; Div class = "meta" & gt; Tags: xxx & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "2" class = "entry" & gt; & Lt; H2 class = "title" & gt; Title for entry 2 & lt; / H2 & gt; & Lt; Div class = "meta" & gt; Tags: xxx & lt; / Div & gt; & Lt; / Div & gt; ... & lt; / Div & gt; 
[div = "content"] /

  @ "/ Div [@ class = 'entry'] // div [@ class = 'meta']"   

This return tag: xxx for both entries.

Comments