Parse an html form
I think that one can not claim to be a REBOL programmer unless one can use "parse." Anyway, let's say I have an html page that contains a form, part of which is shown below. I want to do a little experimenting with generating python code, so I want to obtain all the "name" attributes for the "input" items on the form. That would be "almform-house," "almform-street," and "almform-submit." I am able to parse off the "form" part of the html page, as shown in the sample below. After that, I can't even parse off one name, let alone all of them, and I have no idea how to proceed. I wonder if someone can offer guidance. Thank you. Code samples follow. Demo form R E B O L [ Title: "Parse html form for input names" ] ;; -- Read the html file HTMLFILE: %rtest-buildmarkup.html HTMLTEXT: read HTMLFILE ;; -- Pick off the html form embedded somewhere in the html file HTMLFORM: copy "" parse HTMLTEXT [thru " |