5 ms·
The issue with CSS selectors is they can only express element selection. There's no concept of picking the text of the element or the value of an attribute. The
by esprehn 4y ago
The issue with CSS selectors is they can only express element selection. There's no concept of picking the text of the element or the value of an attribute. There's been proposals over the years to support pseudo elements for that, so you could make something up like ::attr(name) and ::text, but nothing in the standards.
htmlq does this by having various command line options like --attribute and --text.
https://github.com/mgdm/htmlq#examples https://github.com/mgdm/htmlq#examples
- samwillis 4y agoQuite a few scraping (such as Scrapy) or browser automated testing frameworks (like Playwright) have standardised on ::text. I would take a look around and if other tools are using the same none standard selectors for these features, it would be perfect for Xq. It's not like you are complying with standards for browser compatibility.