0

i m using php file for using data in my application, in this file i post data on the server and if i get the data from the server then it is in html formate.

so problem is that i have a string with html tags how i use data in that string. how i extract data from html string.

Pradeep
  • 179
  • 1
  • 3
  • 17

4 Answers4

2

Use NSXMLParser class. it works for HTML too. There are three useful delegate methods.

Ideveloper
  • 1,467
  • 4
  • 23
  • 44
1

If your HTML out put is some simple data - may be you can write some simple NSString parser your self like 'markhunte' mentioned, if you have large complex data in HTML then you have to go for some open source parsers.

Cocoa does not provide HTML parser, Forum discussion claims in some case XML parser itself work for you, but I never go it working for my data.

In my case I had very simple TAG which I had handled using my own parser using NSString.

Girish Kolari
  • 2,515
  • 2
  • 24
  • 34
0

I have used the code from --> Flatten-html-content-ie-strip-tags-cocoaobjective-c. There are also examples of its use on SO.

markhunte
  • 6,805
  • 2
  • 25
  • 44
0

Just use NSScanner, it is great for searching in between tags that are permanent. If you post some page code I help you set up the scanner.

dgund
  • 3,459
  • 4
  • 39
  • 64