HTTP.Fetch HTML -> Table or JSON, Can it be done?

Let’s say I have this:
[lua]
http.Fetch( “http://www.wikipedia.org/”,
function( body ) print(body) end,
function( error ) print(error) end
)
[/lua]
It will output this giant string of the page’s source.
How can I turn this into a manageable table/json that I can use?
This website: http://json.fastfrag.org/ does exactly what I’m talking about.

Garry’s Mod doesn’t contain any Lua features that could be used to parse HTML into DOM tree. Also note that not all pages out there are valid and many of them couldn’t be ‘converted’ into a JSON structure like that.
Either use string.find to extract the information you require, or spawn a HTML panel and run some JavaScript in the window (you can traverse the document tree with JS).

A lot of sites do have an API that supports JSON though. What are you trying to do?

Wikipedia API

You could probably host your own website with fastfrag on it and have it accept post info.