RightNow21 Posted August 15, 2006 Share Posted August 15, 2006 Any one know how to parse an external html page?I know how to parse a html file on my server.<?php$filename = "test.html";$file = fopen($filename, "r");$filesize = filesize($filename);$text = fread($file, $filesize);fclose($file);echo $text;?>But how would I parse:someone-else.com/filename.html Quote Link to comment Share on other sites More sharing options...
Prismatic Posted August 15, 2006 Share Posted August 15, 2006 [code=php:0]/* $File will be a string containing all the HTML for google.com */$File = file_get_contents("http://www.google.com");[/code] Quote Link to comment Share on other sites More sharing options...
RightNow21 Posted August 15, 2006 Author Share Posted August 15, 2006 Thanks!!!!!Works like a charm.http://www.darynduff.com/crawler/<?php$file = file_get_contents("http://www.google.com");//$file = fopen($filename, "r");//$filesize = filesize($file);//$text = fread($file, $filesize);//fclose($file);echo $file;?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.