Getting code from a site

Soldato
Joined
15 Dec 2004
Posts
3,819
Hi,

I am currently designing a website that needs to pull information from another site. I'm looking at doing this in PHP but I only need a certain section of the code- for example from <a name="start" /> to <a name="end" />. Would this be possible in PHP and how would I go about it?

Thanks

Ben
 
One method would be to get all of the html using Snoopy and then either use regex to select your html and go from there or you could try an XML/HTML parser/DOM but you'd have to be sure the markup is all valid.
 
Thanks, I've looked at them both but am a bit worried about the security of snoopy as there is a security patch on their site- how safe is this exactly? Security has got to be top priority :)

I can't find much information on regex though- so far I've got that it's a javascript command but not mcuh on how to use it.

The problem I have is that I cannot directly edit the HTML of the site its pulling from- it has a content manager type interface that can accept basic HTML though.

Anyway, any help on how I would go about using those would be very much appreciated :)

Thanks

Ben
 
Back
Top Bottom