Parsing HTML fields

From: VI (VI_at_invent.co.uk)
Date: 03/11/04


Date: Thu, 11 Mar 2004 10:10:49 +0000

Hi all,

I've got some HTML text in the form of a String. From this I want to
collect all the names, types and values.

e.g. <input type="checkbox" name="homepage" value="Y">

There will be many more of these in one string with the possibility of
more that one type (e.g. checkbox and textfield).

I know how to do this the long-winded way (using String/StringBuffer
methods), but I'm sure there is a neater way using the regex package or
StringTokenizer or the like?

I was wondering if anyone had any ideas?

Cheers

VI



Relevant Pages

  • Re: Searching local pages for visible text
    ... example that finds 61 copies of the string "center". ... in HTML, in CSS, and in the display of a page section on spelling, only. ... As you are using textContent/innerText, ... That has unveiled a bug in Google Translate: it claims to be able to ...
    (comp.lang.javascript)
  • Re: You need to identify the objects on the web page that have the values entered.
    ... Function ZipPlusFour(sAdd1 As String, _ ... Dim sResult As String ... Take the html text and put it in a file called ...
    (microsoft.public.excel.programming)
  • Re: getAttribute question
    ... oddity with IE that getAttributereturns an empty string if the ... HTML specification, ... appropriate places in the HTML 4 and DOM HTML specifications. ...
    (comp.lang.javascript)
  • Re: [PHP] generating an html intro text ...
    ... You would have to search out and pull in all closing tags. ... grab 256 characters -- The string. ... html markup should not go towards the string length count, ...
    (php.general)
  • Re: Parsing String of Named Function & Converting To Source
    ... Invalid HTML 4 markup. ... You should escape the </ inside the string. ... All of this markup and contained script code is retrieved as a string using ... multiple levels of execution contexts, ...
    (comp.lang.javascript)