Call to a member function find() on a non-object str_get_html



  • There's a variable. $htmlreceived through curl (all working). I want to get it. div Class partscontrol:

    $simpleHTML = new SimpleHTMLDOM;
    $div=$simpleHTML->str_get_html($html);
    $results=$div->find('.partscontrol');
    

    but... $results returns empty space. If you're looking, <div> or <a> It works. What's the nail? Options ('.partscontrol',0)('div.partscontrol',0)('div.partscontrol')('div.partscontrol',0)- That's the same thing.



  • You've got to what you're looking for in class.

    $results=$div->find('div[class=partscontrol]');
    

    or sometimes it might work.

    $results=$div->find('div[class="partscontrol"]');
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2