By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

Parsing Html

P: n/a
Anyone have any ideas how to parse a html document.

I am trying to extract out specific information from the page.
Also, what do you do if the page is dynamic (e.g. a cgi generated page) how
do you find it??

Thanks
Colum.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Colum wrote:
I am trying to extract out specific information from the page.
Also, what do you do if the page is dynamic (e.g. a cgi generated page) how
do you find it??


It depends *very*much* on what you're trying to extract.
I once had my motd come from

<?php
$x = `curl -s http://www.care2.com/`;
$t = strpos($x, 'DAILY QUACK UP');
$y = substr($x, $t, 300);
$t = strpos($y, '</td>');
$z = substr($y, 0, $t);
$z = str_replace('</b></font></a><br>', '', $z);
$z = str_replace('<BR>', '', $z);
echo $z;
?>

Just retested this ... still works :)

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #2

P: n/a
Hello,

On 10/30/2003 07:46 PM, Colum wrote:
Anyone have any ideas how to parse a html document.

I am trying to extract out specific information from the page.
Also, what do you do if the page is dynamic (e.g. a cgi generated page) how
do you find it??


You may want to try these classes:

Class: HTMLparser
http://www.phpclasses.org/browse.html/package/244.html

Class: HTMLSax
http://www.phpclasses.org/htmlsax
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.