src/Net/Site/Crawler.php
protected function getDocument( $content, $url )
	{
		$doc = new DOMDocument();
		ob_start();
		if( !@$doc->loadHTML( $content ) )
		{
			$content	= ob_get_clean();
			if( $content )
				$this->errors[$url]	= $content;
			throw new RuntimeException( 'Error reading HTML.' );
		}
		ob_end_clean();
		return $doc;
	}
protected function getDocument( $content, $url )
	{
		$doc = new DOMDocument();
		ob_start();
		if( !@$doc->loadHTML( $content ) )
		{
			$content	= ob_get_clean();
			if( $content )
				$this->errors[$url]	= $content;
			throw new RuntimeException( 'Error reading HTML.' );
		}
		ob_end_clean();
		return $doc;
	}
protected function getDocument ( $ content , $ url ) { $ doc = new DOMDocument ( ) ; ob_start ( ) ; if ( ! @ $ doc -> loadHTML ( $ content ) ) { $ content = ob_get_clean ( ) ; if ( $ content ) $ this -> errors [ $ url ] = $ content ; throw new RuntimeException ( 'Error reading HTML.' ) ; } ob_end_clean ( ) ; return $ doc ; }
Tries to get DOM Document from HTML Content or logs Errors and throws Exception.
@access		public
@param		string		$content		HTML Content
@param		string		$url			URL of HTML Page
@return		DOMDocument
Tries to get DOM Document from HTML Content or logs Errors and throws Exception .