This article mainly introduces the usage of the dom class of Codeigniter. The example analyzes the dom Operation Skills Based on Codeigniter. For more information, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
Using simple_html_dom dom class as a class library modified by CI, you can analyze HTML elements like JavaScript, which is suitable for analyzing webpage data when crawling webpages.
Class Library: http://sourceforge.net/projects/simplehtmldom/
Modify:
Replace simple_html_dom with CI_Simple_html_dom in batches.
Placed under application \ libraries:
Function index () {// $ this-> load-> view ('Welcome _ message'); $ this-> load-> library ('simple _ html_dom '); $ html = file_get_html ('HTTP: // localhost/test.htm'); foreach ($ html-> find ('A') as $ e) echo $ e-> href.'
';}
I hope this article will help you with Codeigniter-based php programming.