Closed marionava closed 4 years ago
Hi, I've try and it' works in Laravel.
use Goutte\Client as Client;
$client = new Client(); $crawler = $client->request('GET', 'https://www.eldolar.info/es-MX/mexico/dia/hoy'); $dolarhoy = $crawler->filter('table#dllsTable>tbody>tr>td.xTimes')->eq(1)->text();
echo $dolarhoy;
I've reviewed the php server version an is 7.1.24.
Is this the bug reason?
Yes, the php version (7.1.*) is the reason...
It would be great if you edit your Readme.rst to
Goutte depends on PHP 7.2+.
If somebody else experienced this bug and can't change the php version like on my case. I changed the Crawler.php file of Symphony
from this
private function createSubCrawler($nodes): object
to this
private function createSubCrawler($nodes)
I know this is not a good practice, but I have not choice.
Hi, I don't know why on my lap everything is working fine and on my server I'm getting this error:
Return value of Symfony\Component\DomCrawler\Crawler::createSubCrawler() must be an instance of Symfony\Component\DomCrawler\object, instance of Symfony\Component\DomCrawler\Crawler returned
My code is on a Laravel Controller
The error is on the second line of the function.
On my server I have php 7.2.26 I'm using "fabpot/goutte": "^4.0"