Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Call to a member function saveXML() on null #333

Open
kolaente opened this issue Jun 26, 2023 · 2 comments
Open

Error: Call to a member function saveXML() on null #333

kolaente opened this issue Jun 26, 2023 · 2 comments

Comments

@kolaente
Copy link

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.

@jtojnar
Copy link
Collaborator

jtojnar commented Jun 26, 2023

Maybe look at #286, it moves the init function.

@kolaente
Copy link
Author

That works! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants