symfony / panther

A browser testing and web crawling library for PHP and Symfony
MIT License
2.93k stars 219 forks source link

TypeError is thrown when calling Crawler::html() #615

Open syl20b opened 9 months ago

syl20b commented 9 months ago

Hello,

I'm upgrading from 2.1.0 to 2.1.1 and I encounter the following error :

TypeError: Symfony\Component\Panther\DomCrawler\Crawler::html(): Return value must be of type string, null returned

It seems that the Crawler::html() method must return a string, but as it calls the Crawler::attr() method under the hood, this can lead to a return null statement when the content is empty.

alexandre-mace commented 7 months ago

I'm also having the same error, temporary downgraded to 2.1.0 (my code works again now) waiting for the PR to be merged, thanks for opening this issue, you saved me a bit of time @syl20b