iphone - How to parse html in iOS to get all its content along with tag name? -


i tried parse html data using tfhpple mentioned below

tfhpple *tutorialsparser = [tfhpple hpplewithhtmldata:tutorialshtmldata]; nsstring *tutorialsxpathquerystring = @"//body"; nsarray *tutorialsnodes = [tutorialsparser searchwithxpathquery:tutorialsxpathquerystring]; 

after done above step getting tutorialsnodes array contain data.
want find each tag in content.
need tag identified image or text etc.
don't understand how it.

something this, perhaps?

  ...   (tfhppleelement *element in tutorialsnodes)   {       [self handleelement:element];   }   ... }  - (void)handleelement:(tfhppleelement *)element {     (tfhppleelement *child in element.children)      {         nsstring *textinsidethechildelement = child.content;          if ([child.tagname isequaltostring:@"img"])         {             nsstring *sourceurl = child.attributes["src"];         }         else          {             [self handleelement:child];         }     } } 

Comments

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -