#119 Can't get elements by chaining classes

Tam Vo


Thanks for your contribution, this library is pretty cool and I love it, it helps my job a lot. But, I found the bug in your library, I can't get elements by chaining element by using:

$html = str_get_html($client->
$a = $html->find(".milestone.okay.tooltipEl");

But $a is empty set, while I use jQuery and can get the elements by above selector.


  • John Schlick

    John Schlick - 2013-01-05

    $html = str_get_html($client->
    is invalid php - so... it's clear that you will never get results from the code you posted. We also have no idea what you meant with "$client->" or what html is contained in it.

    Please post an example of simple_html_dom failing using the new tester in the example/example_scraping_general.php

    include the webpage/url that you are getting, and then include a line that shows the issue.

  • Tam Vo

    Tam Vo - 2013-01-11

    Sorry for my mistake in above snippet. For example, I have simple dom element like this:

    But I can't get any element, although as you can see, we can get above element by jQuery with this query: $(".class1.class2.class3"), right? I also take a look in your examples in the source, but can't find any similar example.

    Thanks for your consideration,

  • Sergey Sidlyarenko

    Use: $a = $html->find('.milestone.okay.tooltipEl', 0);

  • Sergey Sidlyarenko

    Use for .class .class .class: $a = $html->find('.class .class .class', 0);


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks