Grab Images Off Webpage

Discussion in 'PHP' started by Num Lock, Mar 27, 2009.

  1. #1
    Is it possible for PHP to grab images off another webpage and give me back the direct link to them?

    Or maybe someone has a sample code they could direct me to.

    Thanks
     
    Num Lock, Mar 27, 2009 IP
  2. jazzcho

    jazzcho Peon

    Messages:
    326
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Search for scraping.
     
    jazzcho, Mar 27, 2009 IP
  3. bhagwant.banger

    bhagwant.banger Active Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    60
    #3
    Yes,

    Use CURL to process pages
    then use DOM to get all elements with tag names as img then get the attribute value of src for the img tags
    then prefix the domain name you have to passed to curl to get the direct link
    remember there may be absolute links to images or there may also be external image links
    so always check for that before prefixing
     
    bhagwant.banger, Mar 27, 2009 IP
  4. Num Lock

    Num Lock Active Member

    Messages:
    1,802
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    80
    #4
    Well I've done some research and I noticed the images are hidden in the source via AJAX, is there any way around this?
     
    Num Lock, Mar 28, 2009 IP
  5. angelsdemise

    angelsdemise Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Like an image crawler?
    angelsdemise.info/crawl.php
     
    angelsdemise, Mar 28, 2009 IP
  6. Num Lock

    Num Lock Active Member

    Messages:
    1,802
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    80
    #6
    Nope, not exactly what I am looking for
     
    Num Lock, Mar 28, 2009 IP