Skip to content

Instantly share code, notes, and snippets.

@h-collector
Last active June 4, 2017 11:00
Show Gist options
  • Save h-collector/e81d3620c28407ff97f2e9ce1e27dce4 to your computer and use it in GitHub Desktop.
Save h-collector/e81d3620c28407ff97f2e9ce1e27dce4 to your computer and use it in GitHub Desktop.
Meh
<?php require 'vendor/autoload.php';
use Goutte\Client;
use GuzzleHttp\Client as GuzzleClient;
$client = new Client();
$client->setClient(new GuzzleClient(array(
'timeout' => 60,
'debug' => true,
)));
$crawler = $client->request('GET', 'http://wikiwiki.jp/aigiszuki');
// tak
$crawler->filter('#menubar a')->each(function ($node) {
print $node->text()."\n";
});
// lub też
foreach ($crawler->filter('#menubar a') as $link) {
echo $link->nodeValue."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment