问题
I need to parse out the values from some data from select boxes.
Example: <option value="1">Apple</option><option value="2">Chicken</option>
Usage: If option = apple then get value.
Any suggestions?
回答1:
DIHtmlParser? I'm not sure how "lightweight" it is, but Ralf's components always seemed to be well put together. He's also normally active and response on Embarcadero's Forums.
If it's a one-off and not too complex, you could probably split on symbols manually.
回答2:
Another option would be the standard XML Parsers...that is if your document meets the XHTML standards.
来源:https://stackoverflow.com/questions/2733972/best-lightweight-html-parser-for-delphi