taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Grouping selectors(comma) has different behavior elem.querySelector #40

Closed bin16 closed 4 years ago

bin16 commented 4 years ago
<article>
<h4>title</h4>
</article>

Suppose elem is the article, elem.querySelector('h3, h4') return null, but elem.querySelectorAll('h3, h4') return array with that h4. Also, on native browser, elem.querySelector('h3, h4') return h4.

So I guess node-html-parser need to do same, just return the first element in array?