htmlSQL class – quite nice way of parsing html

Today I found a class written in PHP which implement the idea of using SQL syntax while parsing HTML documents – htmlSQL. The idea of the author – Jonas David John – is quite simple. If you want to parse a HTML document, let’s way you want to parse all divs with class “row”,the syntax will look like normal SQL:

SELECT * FROM div WHERE $class == "row"

Looking familiar isn’t it? There is also function connect() /which define the html source/ and fetch_array() which contain the results after the query.

There are few examples included in the library package and here is the simplest one:
Continue reading

Share it:
  • Facebook
  • Twitter
  • Digg
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Yahoo! Buzz
  • Add to favorites
  • Identi.ca