Artenis Posted April 1, 2009 Report Share Posted April 1, 2009 Sveiki! Varbūt kādam ir kāds normāls risinājums, kā savākt no kādas lapas informāciju? Piemēram konkrētas <div> klases tekstu? Meklējot atradu tādu screen Scraping tik īsti cik skatījos nebija tas, kas vajadzīgs, bet varbūt tomēr? Paldies. Quote Link to comment Share on other sites More sharing options...
marcis Posted April 1, 2009 Report Share Posted April 1, 2009 file_get_contents() + regular expressions Quote Link to comment Share on other sites More sharing options...
Delfins Posted April 1, 2009 Report Share Posted April 1, 2009 vai CURL bibliotēka, ja vajag arī postot Quote Link to comment Share on other sites More sharing options...
Ghenis Posted April 3, 2009 Report Share Posted April 3, 2009 CURL + SimpleXML FTW Quote Link to comment Share on other sites More sharing options...
rollmax Posted April 4, 2009 Report Share Posted April 4, 2009 Requirements: PHP 5+ $Url = "http://php.lv/index.php"; $Handle = @fopen($Url, "rb"); $Contents = stream_get_contents($Handle); fclose($Handle); $klase = "ipb-top-left-link"; $RegExCode = ".*<div.*class=\"$klase\">(.*)</div>"; preg_match($RegExCode, $Contents, $results); print_r($results); Nomaini $Url, $RegExCode Kaut kam tādam vajadzētu strādāt. Ja nestrādā, tad pielabo skatoties php.net dokumentāciju :] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.