tidy_parser.php
public function parse($response)
    {
        $this->page = new SimplePage($response);
        $tidied     = tidy_parse_string($input = $this->insertGuards($response->getContent()),
                                    array('output-xml' => false, 'wrap' => '0', 'indent' => 'no'),
                                    'latin1');
        $this->walkTree($tidied->html());
        $this->attachLabels($this->widgets_by_id, $this->labels);
        $this->page->setForms($this->forms);
        $page = $this->page;
        $this->free();

        return $page;
    }
public function parse($response)
    {
        $this->page = new SimplePage($response);
        $tidied     = tidy_parse_string($input = $this->insertGuards($response->getContent()),
                                    array('output-xml' => false, 'wrap' => '0', 'indent' => 'no'),
                                    'latin1');
        $this->walkTree($tidied->html());
        $this->attachLabels($this->widgets_by_id, $this->labels);
        $this->page->setForms($this->forms);
        $page = $this->page;
        $this->free();

        return $page;
    }
Reads the raw content the page using HTML Tidy.

@param $response SimpleHttpResponse  Fetched response.

@return SimplePage                   Newly parsed page.