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.

4
  • Could you be more precise on what you are looking for in the html? Commented Jul 27, 2010 at 8:09
  • Possible duplicate of: stackoverflow.com/questions/405749/parsing-html-on-the-iphone stackoverflow.com/questions/2739670/… and more Commented Jul 27, 2010 at 8:13
  • i search alot but not found satisfied answer please suggest me!!!!!! Commented Jul 27, 2010 at 9:24
  • I'm just gonna say it: Please don't use regular expressions to try and solve this. Commented Jul 27, 2010 at 9:50

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

0

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

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.