I'm actually not parsing the HTML at all. Not really. I'm using PhantomJS, which is a headless web browser. Each time I load a page, I inject jQuery and just do a simple JS command like
$('#whatevertheIDisfortheform').submit();
It's the equivalent of opening up your console on each page and interacting with it via jQuery rather than a mouse and keyboard.