enkuso

mongol bank currency rate crawler

Oct 22nd, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. require_once '/path/to/goutte.phar';
  2.  
  3. use Goutte\Client;
  4.  
  5. $client = new Client();
  6.  
  7. $crawler = $client->request('GET', 'http://mongolbank.mn/dblistofficialdailyrate.aspx');
  8.  
  9. $currency = "USD";
  10.  
  11. $rates = array();
  12. $rates[$currency] = $crawler->filter('span#MainContent_lbl' + $currency)->text();
  13.  
  14. print_r($rates);
Add Comment
Please, Sign In to add comment