graby
graby copied to clipboard
Error: Call to a member function saveXML() on null
I'm trying to run Graby like this:
$graby = new Graby();
$graby->fetchContent('http://www.bbc.com/news/entertainment-arts-32547474');
it fails with this error:
Error: Call to a member function saveXML() on null
/opt/project/vendor/j0k3r/graby/src/Extractor/ContentExtractor.php:163
/opt/project/vendor/j0k3r/graby/src/Graby.php:318
/opt/project/vendor/j0k3r/graby/src/Graby.php:136
/opt/project/tests/Feature/HttpCrawlTest.php:39
I dug in a little, and it seems like the $dom property of the Readability class never gets initialized. I wonder why that is the case?
I'm using php 8.2 with the changes from #332.
Maybe look at https://github.com/j0k3r/graby/pull/286, it moves the init function.
That works! Thanks!