This is the code I am using
require_once 'goutte.phar';
use Goutte\Client;
$client = new Client();
for($i=0;$i<10;$i++){
$crawler = $client->request('GET', 'http://website.com');
echo '<p>'.$crawler->filterXpath('//meta[@property="og:description"]')->attr('content').'</p>';
echo '<p>'.$crawler->filter('title')->text().'</p>';
}
This works but takes a lot of time to process? Is there any way to do it faster.
For starters, there is nothing asynchronous about your code sample. Which means that your application will sequentially, perform a get request, wait for the response, parse the response and then loop back.
While Goutte uses Guzzle internally, it does not make use of Guzzles asynchronous capabilities.
To truly make your code asynchronous you will want to refer to the Guzzle Documentation on:
Your code sample above would result in something like: