wll6568 Posted May 4, 2007 Share Posted May 4, 2007 Hi all, Can someone tell me how to extract a portion of HTML codes from an existing web page? I tried to extract a table from a downloaded web page but cant get no luck: $fh = fopen($url, "r"); while(!feof($fh)){ $download = htmlspecialchars(fgets($fh, 902400)) . "<br />"; //$outputvalue = EXTRACT A TABLE FROM $download; } echo($outputvalue); Link to comment https://forums.phpfreaks.com/topic/49936-extract-data-fro-web-page/ Share on other sites More sharing options...
genericnumber1 Posted May 4, 2007 Share Posted May 4, 2007 if you don't mind loading the page into memory you could just use a simple file_get_contents() with some regex to pull out the table. Link to comment https://forums.phpfreaks.com/topic/49936-extract-data-fro-web-page/#findComment-245170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.