Coast Line
asked on
fetching all images from a URL
i need to get images from a webpage source. i can use cfhttp to load page contents
need to loop through the content to get all image url's(src)
can i use rematch() or refind() etc... and if yes how??
if im not clear i can try to clarify..
with that, once i fetch images, i just want to specify to fetch images which has image size of 800*600 only
Any idea
need to loop through the content to get all image url's(src)
can i use rematch() or refind() etc... and if yes how??
if im not clear i can try to clarify..
with that, once i fetch images, i just want to specify to fetch images which has image size of 800*600 only
Any idea
ASKER
I am getting url like this
http://www.santabanta.com/photos/neha-dhupia/443114.htm?high=1http://media.santabanta.com/medium1/Global Celebrities(F)/Sunny Leone/sunny-leone-75a.jpg
http://www.santabanta.com/photos/neha-dhupia/443114.htm?high=1http://media.santabanta.com/medium1/Global Celebrities(F)/Sunny Leone/sunny-leone-75a.jpg
Could you please show the code you are using, with the the CFHTTP url as well.
Tom
Tom
ASKER
this is the code i used:
<cfhttp url="http://www.santabanta.com/photos/neha-dhupia/443114.htm?high=1" method="get">
<cfset images = reMatchNoCase("<img ([^>]*[^/]?)>", cfhttp.FileContent)>
<cfloop array="#images#" index="img">
<cfset src="YOUR_URL_HERE#REReplace(img, "^.*<img[^>]+src=(['""])([^'""]+)\1[^>]*>.*$", "\2")#">
<cfset imgInfo=ImageNew(src)>
<cfif imgInfo.width EQ 800 AND imgInfo.height EQ 600>
Using cfcontent here
</cfif>
</cfloop>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i tried the code but it does not fetch all images
this link
http://www.santabanta.com/wallpapers/neha-dhupia/
shows the images of the celebrity in thumbnail positions, with paging at the bottom, need to fetch the 800 *600 of all the images of the that celebrity, i know i am asking too much
this link
http://www.santabanta.com/wallpapers/neha-dhupia/
shows the images of the celebrity in thumbnail positions, with paging at the bottom, need to fetch the 800 *600 of all the images of the that celebrity, i know i am asking too much
ASKER
Thanks, Changing few things made it work
Open in new window