Scrape parts of a page (php)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edskellington
    New Member
    • Nov 2009
    • 2

    Scrape parts of a page (php)

    I'm looking to scrape an image off a website. The image changes daily. The image name however consistently starts with "product_image" . How could I search for any image with that beginning, and then display it on a page, probably appending the url of the site to it as well.

    Also, is it pretty simple once I pull the image to drop it in a database?

    Thanks so much for any help you can give!
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    Yes, you only need to add the URL of the page to the image source.
    Like: http://www.example.com/images/image.jpg

    Originally posted by edskellington
    Also, is it pretty simple once I pull the image to drop it in a database?
    Could you explain that a little better?
    Don't really understand what yo mean.

    Comment

    • edskellington
      New Member
      • Nov 2009
      • 2

      #3
      I'm looking to build an aggregation site which will contain 6 images from 6 different sites.

      So for instance, I want to pull down the detail image from http://teefury.com. Here is the code.

      Code:
      <div id="product_design">
      <table width="100%" cellspacing="0" cellpadding="0" border="0">
      <tbody>
      <tr>
      </tr>
      <tr>
      <td valign="top" colspan="3">
      <img border="0" src="products_large_images/bottom-sfl.jpg"/>
      </td>
      </tr>
      </tbody>
      </table>
      </div>
      This image changes everyday because the website sells a new shirt everyday, (like WOOT.com)

      I want to display THAT one image... but when I pull down that chunk of code, obviously the image isn't working cause the full path isn't on there.... so how do I append the first part of the url "http://teefury.com/"

      The end part of that url will change "bottom-sfl.jpg" but the first part "products_large _images" won't so that is my constant. If that makes sense...?

      Thanks, hope that helps! Thanks in advance!
      Last edited by Atli; Nov 11 '09, 04:21 PM. Reason: Changed [quote] to [code] tags.

      Comment

      Working...