[REBOL] HTML thingy
From: brett::codeconscious::com at: 10-Oct-2000 1:20
Two scripts to mention.
Newly updated. It converts a rebol tag! to a block! suitable for use with
the build-tag function.
>> print build-tag probe import-tag <body bgcolor="red" link="blue">
[body bgcolor "red" link "blue"]
<body bgcolor="red" link="blue">
Leveraging off load/markup and tag-tool.r I came up with this rudimentry
HTML querying/manipulation scheme. I thought I would post it here because
it may be useful for others that want to get a bit of data out of an HTML
page or change the odd attribute here or there.
It doesn't understand HTML structure though so don't expect too much.
Here's an example of what it can do:
>> unique tags/attribute load-html http://www.rebol.com/ 'href
== [[A HREF "http://www.rebol.com"] [A HREF "sitemap.html"] [A HREF
] [A HREF
"products.html"] [A HREF "technology....
Another example showing HTML manipulation is in the script itself.
It occurs to me that with the tag name now seperated out and some tag types
identified, one could start building something that interprets HTML
structure. But that idea is a little to ambitious for me just now.
Rather than filling your inbox I've uploaded these scripts to my site, so
you can find them here: