Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-20-2010, 12:34 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 14
eduard510 is on a distinguished road
Default get all images from HTML

How can i get all image path from URL ?

For Example : I get the html source from a URL. this URL have a lot of image source <img src = "what ever image path">. How can i get the "what ever image path" and save them in Array.
eduard510 is offline   Reply With Quote
Old 09-20-2010, 01:04 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 107
JDave is on a distinguished road
Default

you mean like this?

Code:
id path = @"http://merrimusings.mu.nu/archives/images/groundhog2.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];
This is from Sadun's 'site':
Creating an UIImage from a URL - O'Reilly Digital Media Blog

Of course, this code does not:
extract the filename/link from an HTML file
release img after creation
check for reachability

Good Luck.

Last edited by JDave; 09-27-2010 at 01:03 AM.
JDave is offline   Reply With Quote
Old 09-20-2010, 06:20 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 14
eduard510 is on a distinguished road
Default Not Exactly

Quote:
Originally Posted by JDave View Post
you mean like this?

Code:
id path = @"http://merrimusings.mu.nu/archives/images/groundhog2.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data cache:NO];
This is from Sadun's 'site':
Creating an UIImage from a URL - O'Reilly Digital Media Blog

Of course, this code does not:
extra the filename/link from an HTML file
release img after creation
check for reachability

Good Luck.
Not Exactly...
For Example i have a site with a content (Texts, images, href links, other..).
how can i get the only text or the only images from this site.

its like you want get all images or the only text that have any wikipedia site.
like you clean the all html source and you only get the images (only that i need get the images path of the site)
eduard510 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 311
13 members and 298 guests
2ndSegment, cayladv57, cgokey, djohnson, Domele, Hamad, linkmx, markuschow, pungs, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:00 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0