php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

Cannot find tags that have additional classes

Open komputronika opened this issue 5 years ago • 1 comments

find method cannot find tag that has additional classes.

For example, I want to find all tags that have 'services' class:

<div class='services'> or <div class='services last-item'> or <div class='services active'>

But, If I run:

$html->find('div[class=services]'); 

I will only get one result:

<div class='services'>

komputronika avatar Feb 05 '20 16:02 komputronika

You need to use .services or div[class~=services]: https://github.com/voku/simple_html_dom/commit/5b1854e3a5540db70342c639b8326622ce57b842

voku avatar Mar 23 '20 00:03 voku