You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example:
$test_string = '<div><span class="NOIsThis">Foo</span></div><div><span
class="IsThis">Bar</span></div>';
$test_html = str_get_dom($test_string);
$spans = $test_html->select('span.IsThis');
echo 'Spans with class IsThis (should be one):'.count($spans);
echo "\r\n";
echo 'This should print Bar:
'.$test_html->select('span.IsThis',0)->getPlainText();
I want select the span with class "IsThis", but, the query returns the first
span (with class "NOIsThis").
I think this is wrong... dont you think?
Original issue reported on code.google.com by Radika...@gmail.com on 10 Sep 2012 at 3:01
The text was updated successfully, but these errors were encountered:
I solved this with:
$test_string = '<div><span class="NOIsThis">Foo</span></div><div><span
class="IsThis">Bar</span></div>';
$test_html = str_get_dom($test_string);
$spans = $test_html->select('span[class="IsThis"]');
echo 'Spans with class IsThis (should be one):'.count($spans);
echo "\r\n";
echo 'This should print Bar:
'.$test_html->select('span[class="IsThis"]',0)->getPlainText();
exit;
Original comment by Radika...@gmail.com on 10 Sep 2012 at 3:24
Original issue reported on code.google.com by
Radika...@gmail.com
on 10 Sep 2012 at 3:01The text was updated successfully, but these errors were encountered: