Symfony panther issue

Viewed 299

I am using Symfony Panther for web scraping. When Google Chrome's version and Chrome driver was 89, everything worked fine. But after updating both versions to 92,

$crawler->filter('h1')->html();

will always return empty string.

I think, the problem is related to this method >html()

Could you please let me know if you have a solution for this.

1 Answers

In case anyone stumbles onto this issue, I ran into this same problem and found a workaround by getting the first element from the crawler selector then the outerHTML property. Some say innerHTML works but that came up blank.

$crawler->filter( 'h1')->getElement(0)->getDomProperty('outerHTML');
Related