iphone - Is it possible to read the contents of a web page into a string so i can parse out the data? -
i'd able iphone load url( or file url points to) string. reason want able can parse string looking tags , extract values it.
the files webpages html or .asp etc.
anybody able give me hints on need achieve kinda of thing?
many thanks, -code
first url
nsurl *anurl = [nsurl urlwithstring:@"http://google.com"];
then turn string
nserror *error; nsstring *htmlstring = [nsstring stringwithcontentsofurl:anurl encoding:nsutf8encoding error:&error];
update:
there documentation on getting contents of url using nsurlconnection adc site
from there can string representation of downloaded data using
nsstring *htmlstring = [[nsstring alloc] initwithdata:urldata encoding:nsutf8encoding];
Comments
Post a Comment