Разделы
Veselov CV | vvShop © 2008 – 2022
Контакты
email:
skype:
Вернуться
» » » Goutte - простой PHP Web Scraper

Goutte - простой PHP Web Scraper


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 > a')->each(function ($node) {
    print $node->text()."\n";
});

https://github.com/FriendsOfPHP/Goutte
Оставить комментарий
Вверх