yasdevelopment Posted August 6, 2017 Share Posted August 6, 2017 PHP Fatal error: Call to a member function find() on boolean line 85 $search = urlencode($title); $html = file_get_html("http://www.letmewatchthis.pl/?tv=&search_keywords=$search&search_section=2"); $elements = $html->find(".index_item h2"); if(!is_null($elements)){ 85 is $elements = $html ->find Quote Link to comment Share on other sites More sharing options...
kon Posted August 6, 2017 Share Posted August 6, 2017 what exactly don't you understand here ? Quote Link to comment Share on other sites More sharing options...
ginerjm Posted August 6, 2017 Share Posted August 6, 2017 What is this "file_get_html" function? I don't see it in the official php manual. Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted August 6, 2017 Share Posted August 6, 2017 Google. It's an abandoned, buggy, useless HTML library which, for some strange reason, has gained popularity among newbies. The solution is simple: Throw away the library and switch to one of the PHP HTML extensions like DOM. You can use XPath to search for elements. Turn your error reporting all the way up and either log the errors (in production) or display them on the screen (during development). Read the manual and learn to handle errors. When a function may return false in case of an error, you need to actually cover that case. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.