Welcome Guest, Not a member yet? Register   Sign In
[Solved] Getting simple_html_dom to work with CI?
#9

[eluser]sophistry[/eluser]
remember to call this helper using the helper function syntax rather than the library (object) syntax:
Code:
$html = file_get_html($next_page);

NOT this:
Code:
$html = $this->simple_html_dom->file_get_html($next_page);

also, if you want to customize your http request this library allows you to take advantage of stream context support. for example, if you want to name your scraper or provide a cookie or choose a language or set a timeout:

Code:
// Create a stream
$opts = array('http'=>array('method'=>"GET",'header'=>"Accept-language: en\r\n"."Cookie: foo=bar\r\n",'user_agent'=>'simple_html_dom'));
$context = stream_context_create($opts);

$html = file_get_html('http://codeigniter.com',FALSE,$context);


Messages In This Thread
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 02:02 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 03:23 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 03:35 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 05:50 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 01:38 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 07:15 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 07:21 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-31-2009, 04:18 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 06-04-2009, 10:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB