- Not CSS selector for elements containing certain text
- Not CSS selector that gets information between two i tags
But just simply, is there CSS selector for output inner text?
E.g., for
<li>foo</li>
<li>bar</li>
I want to scrape/get/output foo
and bar
, the inner text, using CSS selector.
Using JavaScript it is
document.querySelectorAll('span')[0].innerText
But I want to use CSS selector only. Here is another example,
<h1 data-view-component="true" class="d-inline mr-3">v6.1.0</h1>
Is there a CSS selector to output inner text of v6.1.0
, that https://pkg.go.dev/github.com/andybalholm/cascadia might be able to support?