0

Possible Duplicate:
Best methods to parse HTML

i am trying to write php a script to parse html pages. I want to be able to parse the elements then traverse through them to check for a certain keyword appearing in that element. I have seen alot of libraries but am unable to get it. CAn someone point me to a tutorial or example which shows how to parse an html document then traverse through the elements. i do not want to creat a page just read a page.

Community
  • 1
  • 1
user434885
  • 1,988
  • 6
  • 29
  • 51
  • *(related)* [Best Methods to parse HTML](http://stackoverflow.com/questions/3577641/best-methods-to-parse-html/3577662#3577662) and [Lots of Examples by ME!](http://stackoverflow.com/search?q=user%3A208809+dom+html) – Gordon Mar 14 '11 at 19:38
  • When I was using PHP, I was always partial to phpQuery: http://code.google.com/p/phpquery/ – coreyward Mar 14 '11 at 19:41
  • Is there a specific reason you want to build this yourself (instead of just using phpQuery or examples by him). – mario Mar 14 '11 at 19:42
  • 1
    [SimpleHTMLDom](http://simplehtmldom.sourceforge.net/) is fairly nice as well. – drudge Mar 14 '11 at 19:44
  • i want to use a library but i cant get it to work i need an example code or tutorial. can someone help me out ? – user434885 Mar 14 '11 at 19:44
  • @user there is plenty of examples at the links I gave if you want to use `DOM` and you can find lots more if you just search SO for things like DOM, DOMDocument, Parse HTML, phpQuery and so on. – Gordon Mar 14 '11 at 19:59
  • @jnpcl I'm sure you wanted to write *barely* than *fairly*. – Gordon Mar 14 '11 at 22:04

0 Answers0