How to get specific data from html page in c object

I am new to iPhone development. I want to display data taken from an html table from a web page. Is there a way to get data from a table in an html page? An HTML page is the source code of a page on a website. I only have a webpage url. From the source code (html file) I should get only a part of the data from the table.

Please help me. Thanks.

+4
source share
3 answers

Why don't you use XPathQeury , which is designed by Matt Gallagher.
This library is very good for analyzing not only XML data, but also HTML data using XPath.
You can use the following XPathQuery function.

NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query); 
+2
source

If you need to parse html, then one of the suggestions for HTML parsers in this thread parsing HTML on iPhone will work.

If you know exactly how the data will be tagged / formatted, you can use NSScanner to quickly rip the data out of the raw HTML.

+1
source

If you also display HTML using UIWebView, you can use its stringByEvaluatingJavaScriptFromString method to get the part you need using JScript

0
source

Source: https://habr.com/ru/post/1299347/


All Articles