|
|
|
|
|
by kbenson
2811 days ago
|
|
The words of the statement matter in specificity. You can parse HTML with a powerful regular expression, but it's not a good tool for the job. That said, I find it a wonderful tool to extract specific portions of an HTML document. If you actually just care about retrieving a few specific bits of data within a page, I've found parsing libraries (including ones that allow for CSS selectors) to be just as brittle to changes as regular expression extraction, and not all that much easier to use, given a good grasp of both technologies. That said, if you need to alter an HTML document in some non-trivial way, parsing is probably the way to go. |
|