Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 805203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:02:48+00:00 2026-05-15T00:02:48+00:00

i need to get images from a webpage source. i can use cfhttp method

  • 0

i need to get images from a webpage source.

i can use cfhttp method get and use htmleditformat() to read the html from that page, now i need to loop through the content to get all image url’s(src)

can i use rematch() or refind() etc… and if yes how??

please help!!!!!

if im not clear i can try to clarify..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:02:49+00:00Added an answer on May 15, 2026 at 12:02 am

    Here’s a function that will probably trip up on a lot of bad cases, but might work if you just need something quick and dirty.

    <cffunction name="getSrcAttributes" access="public" output="No">
        <cfargument name="pageContents" required="Yes" type="string" default="" />
    
        <cfset var continueSearch = true />
        <cfset var cursor = "" />
        <cfset var startPos = 0 />
        <cfset var finalPos = 0 />
        <cfset var images = ArrayNew(1) />
    
        <cfloop condition="continueSearch eq true">
            <cfset cursor = REFindNoCase("src\=?[\""\']", arguments.pageContents, startPos, true) />
    
            <cfif cursor.pos[1] neq 0>
                <cfset startPos = (cursor.pos[1] + cursor.len[1]) />
                <cfset finalPos = REFindNoCase("[\""\'\s]", arguments.pageContents, startPos) />
                <cfset imgSrc = Mid(arguments.pageContents, startPos, finalPos - startPos) />
    
                <cfset ArrayAppend(images, imgSrc) />
            <cfelse>
                <cfset continueSearch = false />
            </cfif>
        </cfloop>
    
        <cfreturn images>
    </cffunction>
    

    Note: I can’t verify at the moment that this code works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get array of images that have to call from server and
I need to get all of the images from one website that are contained
I need to store locally on android devices some images I get from the
I need to get the image names of four images from an image lookup
i need to import images from a third party source. the import file looks
I get with Mechanize a array with every images from a web page with
I am using Java to get a chunk of HTML from a web page.
I need to get images from Google Chart, but I'm behind a proxy. With
I have some images I need to get from the web. Just using data
So I need to get images and xml from a server using this URN

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.