in reply to Core module to parse html

It isn't a core module, but I would probably start by considering HTML::DOM for this since it has handy methods like getElementById, getElementsByName and getElementsByClassName which pretty much covers your spec here.