How can I get an url of an image on any site programmatically?
Maybe I can do it with AFNetworking?
Thank you in advance!!!
How can I get an url of an image on any site programmatically?
Maybe I can do it with AFNetworking?
Thank you in advance!!!
load the html, parse it using NSXMLParser and handle the callback for every img tag it finds. in there you can ask for the src attribute of that image tag and BOOM you get the url :)
also see this post for further info on how to use the parser Using an NSXMLParser to parse HTML
//MOCK-Code
NSXmlParser *p = [[NSXMLParser alloc] initWithURL:pageToParse];
p.delegate = self;
[p parse];
- parserDidStart:(id)nodeOfName withAttributes:(id)listOfAttributes {
id src = [listOfAttributes objectForKey:@"src"];
...