Last active
June 4, 2017 11:00
-
-
Save h-collector/e81d3620c28407ff97f2e9ce1e27dce4 to your computer and use it in GitHub Desktop.
Meh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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