selectolax
selectolax copied to clipboard
HTMLParser and LexborHTMLParser search differently
in``` 'td class="table-main__odds" data-odd="3.45" data-oid="6e0f1xv498x0x0" /td'
css_first('[data-odd]') doesn't find attribute for LexborHTMLParser
but HTMLParser finds this attribute
I removed the tags <> because they were not shown in the topic
Hi @SkySandy
This is the correct behavior for HTML (LexborHTMLParser ).
Unfortunately HTMLParser does not handle the above example correctly.
<td class="table-main__odds" data-odd="3.45" data-oid="6e0f1xv498x0x0"></td>
A TD tag without a TABLE tag will be deleted (not inserted into the final HTML tree).
Actually, that's why it can't be found through the selector, it's just not there.
Try opening your example in a modern browser and you'll see exactly the same behavior.