<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Lee &#187; dom</title>
	<atom:link href="http://www.weblee.co.uk/tag/dom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.weblee.co.uk</link>
	<description>PHP Freelance Developer</description>
	<lastBuildDate>Sun, 19 Jul 2009 14:38:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Dom Helper For Codeigniter</title>
		<link>http://www.weblee.co.uk/2009/06/18/simple-dom-helper-for-codeigniter/</link>
		<comments>http://www.weblee.co.uk/2009/06/18/simple-dom-helper-for-codeigniter/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 00:31:38 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[screen scraping]]></category>

		<guid isPermaLink="false">http://www.weblee.co.uk/?p=250</guid>
		<description><![CDATA[Screen scraping with PHP Curl has always been a pain in the arse but Simple Html Dom makes the job a walk in the park.
Being that Simple HTML Dom is a class you would normally create a library fot it, but in this case it fits perfect as a helper. let me show you.


class Welcome [...]]]></description>
			<content:encoded><![CDATA[<p>Screen scraping with <a title="PHP Curl Library" href="http://uk3.php.net/curl" target="_blank">PHP Curl</a> has always been a pain in the arse but <a title="Simple HTML Dom" href="http://simplehtmldom.sourceforge.net/" target="_blank">Simple Html Dom</a> makes the job a walk in the park.</p>
<p>Being that Simple HTML Dom is a class you would normally create a library fot it, but in this case it fits perfect as a helper. let me show you.</p>
<p><span id="more-250"></span></p>
<pre class="brush: php;">
class Welcome extends Controller
{

	function __construct()
	{
		parent::Controller();
		$this-&gt;load-&gt;helper('dom');
	}

	public function index()
	{
		// Grab HTML From the URL
		$html = file_get_html('http://codeigniter.com/');

		// find all link on Codeigniter Site
		foreach($html-&gt;find('a') as $e)
    	echo $e-&gt;href . '&lt;br&gt;';
	}
}
</pre>
<p>Produces a list like this:</p>
<p><img class="size-full wp-image-253 alignnone" title="Screen Scrape Example" src="http://www.weblee.co.uk/wp-content/uploads/scrape.png" alt="Screen Scrape Example" width="286" height="253" /></p>
<p>You cant get it much easier.</p>
<p>On the simple dom web site they give you good examples on how to use the parser and within the download they also give extended examples.</p>
<p>You can either download files from there site or download the ci dom helper and a copy of their files <a href="http://www.weblee.co.uk/wp-content/plugins/download-monitor/download.php?id=8" class="source" title="Simple Dom Helper"><span>here</span></a> .</p>
<p>Happy Scrapping.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.weblee.co.uk/2009/06/18/simple-dom-helper-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
