Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Goutte Playground
require_once __DIR__.'/vendor/autoload.php';
use Goutte\Client;
$client = new Client();
// Login page
$crawler = $client->request('GET', '');
// Select Login form
$form = $crawler->selectButton('Log in')->form();
// Submit form
$crawler = $client->submit($form, array(
'user' => 'x3demob',
'pass' => 'x3demob',
// PHP Configuration page
$link = $crawler->selectLink('PHP Configuration')->link();
$crawler = $client->click($link);
// Find PHP Configuration rows
$configurationRows = $crawler->filter('#phptbl tbody tr');
$configurationRows->each(function($configurationRow, $index) {
$directive = $configurationRow->filter('td')->eq(1)->text();
$value = $configurationRow->filter('td')->eq(3)->text();
echo sprintf("%-20s = %s\n", $directive, $value);
"require": {
"fabpot/goutte": "1.0.*@dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.