2016-06-21 5 views
1

laravelのgoutteを使ってFacebookにログインしたい。 彼らはgithubにログインするドキュメントですが、Facebookにログインして、そのページで利用できる人の名前をすべて取得したいと考えています。laravelのgoutteを使ってFacebookにログインする方法

InvalidArgumentException in Crawler.php line 822: 
The current node list is empty. 

は私を助けてください。私は

$crawler = $client->request('GET', 'https://www.facebook.com'); 
    $form = $crawler->selectButton('Log In')->form(); 

    $crawler = $client->submit($form, array('email' => 'fabpot', 'pass' => 'xxxxxx')); 
    // submit that form 
    $crawler = $client->submit($form); 
    echo $crawler->html(); 

    return $this->render('scraperBundle:Thing:index.html.twig'); 

をしようとしています。しかし、私はエラーを取得しています何 。これを試してみてください

答えて

0

は動作しますです

$client = new Client(); 
$crawler = $client->request('GET', 'https://en-gb.facebook.com/login/'); 
$form = $crawler->selectButton('Log In')->form(); 
$crawler = $client->submit($form, array('email' => 'email', 'pass' => 'pass')); 
$crawler->filter('.flash-error')->each(function ($node) { 
    print $node->text()."\n"; 
}); 
echo $crawler->html(); 
関連する問題