Connecting Tech Pros Worldwide Help | Site Map

Parsing Html

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:51 AM
Colum
Guest
 
Posts: n/a
Default Parsing Html

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.



  #2  
Old July 17th, 2005, 12:51 AM
Pedro
Guest
 
Posts: n/a
Default Re: Parsing Html

Colum wrote:[color=blue]
> 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??[/color]

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.
  #3  
Old July 17th, 2005, 12:51 AM
Manuel Lemos
Guest
 
Posts: n/a
Default Re: Parsing Html

Hello,

On 10/30/2003 07:46 PM, Colum wrote:[color=blue]
> 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??[/color]

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/

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.