RE: [PHP] html to xml?
| From: | Edward Kay | Date: | Wed, 12 Sep 2007 10:00:26 +0000 |
| Subject: | RE: [PHP] html to xml? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-262001@lists.php.net to get a copy of this message | ||
> Slith wrote:
>
> > i need to parse an html page for tabular data which i can then import
> > into mysql so i thought converting the html to xml might be a feasible
> > thing to do, however, other than using tidy from the command line i
> > can't find a way to do this from php.
> >
> > does anyone know of any class (or other) that would allow me to do
> > this? or maybe i just need a different approach.
>
> Is this a one-off or will you be doing this often?
>
> For a one-off I would just use sed/grep/awk/cut/tr etc. - HTML pages are
> rarely syntactically correct, so trying to parse them or even turn them
> into XML is tiresome at best.
For one-off, I'd simply copy/paste the data from the browser into Excel/OO Calc and save as
CSV.
Edward