Analysing page content

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi All,
    I'd like to be able to request a page from a server and then be able to  
analyse the content (rather than rendering it to the screen of my browser)  
in php. I guess this is a bit like how a robot works. I've got quite a lot  
of php knowledge already, but I can't think of how to do this.

Has anybody any ideas on the types of functions or mechnisms I should be  
using for this?.

Thanks in advance,

Re: Analysing page content

Dave schrieb:
Quoted text here. Click to load it

Well. fsockopen/fwrite/fget or Curl for your connection and then regex
should help to get the content into a usable form.

Re: Analysing page content

An noise sounding like adlerweb said:
Quoted text here. Click to load it

Normal fopen will also work on a URL.


Trees with square roots don't have very natural logs.
What's the difference between ignorance and apathy? Who knows? Who cares?

Re: Analysing page content

<Wed, 22 Nov 2006 14:13:06 -0000>

Quoted text here. Click to load it


$ganja=" ";

$handle=fopen($ganja,"rb"); $contents='';
while (!feof($handle)) {$contents .= fread($handle,8192);}


$fp=fopen($filename,"w"); fwrite ($fp,$whatever); fwrite ($fp,"\n");  


The above will grab the webpage and strip the html tags before saving it  
as a text file .

Site Timeline