Goutte (crawler)

PHP эмулятор браузера

https://github.com/fabpot/Goutte

Get

use Goutte\Client; $client = new Client(); $crawler = $client->request('GET', 'http://www.symfony.com/blog/'); $link = $crawler->selectLink('Security Advisories')->link(); $crawler = $client->click($link); $crawler->filter('h2.post > a')->each(function ($node) { print $node->text()."\n"; });

Submit

use Goutte\Client; $client = new Client(); $crawler = $client->request('GET', 'http://github.com/'); $crawler = $client->click($crawler->selectLink('Sign in')->link()); $form = $crawler->selectButton('Sign in')->form(); $crawler = $client->submit($form, array('login' => 'fabpot', 'password' => 'xxxxxx')); $crawler->filter('.flash-error')->each(function ($node) { print $node->text()."\n"; });