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 Link to comment https://forums.phpfreaks.com/topic/17660-parse-html-page/ 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] Link to comment https://forums.phpfreaks.com/topic/17660-parse-html-page/#findComment-75282 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;?> Link to comment https://forums.phpfreaks.com/topic/17660-parse-html-page/#findComment-75283 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.