partial rewrite using htmlparser2