Because the technology is not enough to capture URLs and webpage content, I am visiting the forum all day. I can see a lot of information about crawling webpages (file_get_contents) and crawling URLs (I don't know what to use. What's going on? It is best to help me with the entire source code. For more information, see. Capture url and webpage content
Due to insufficient technology, I spent all day on forums. I can see a lot of information about crawling webpages (file_get_contents) and crawling URLs (I don't know what to use. What's going on? It is best to help me with the entire source code. For more information, see.
Share: More
------ Solution --------------------
$ Url = 'http: // www.iheima.com /';
$ Con = file_get_contents ($ url );
If ($ con ){
Preg_match_all ('/(. +) <\/a> .*
(. +) <\/P>/isU ', $ con, $ temp, PREG_SET_ORDER );
Foreach ($ temp as $ key => $ v ){
$ Title = $ v [2];
$ V_url = $ v [1];
$ Des = $ v [3];
$ Con_url = file_get_contents ($ v_url );
If ($ con_url ){
$ Tags = '';
Preg_match ('/keywords "content =" (. +) "/isu', $ con_url, $ tags );
$ Tags = trim ($ tags [1], ',');
Preg_match ('/class = "txs_Content". *> (. +) <\/p>/isU', $ con_url, $ txt );
$ Txt = $ txt [1];
}
}
} Is it clear enough?