Element.bySelector

struct Element
bySelector
(
string selector
)

Examples

Document doc = Document(
`<html><body>
    <ul><li>one</li><li id="this">two</li></ul>
    <h4>title</h4>
    <ul><li>three</li><li>four</li><li>five</li></ul>
`);

import std.array;
Element[] res = doc.bySelector("h4+ul li:nth-of-type(2), #this").array;

assert(res.length == 2);
assert(res[0].innerText == "four");
assert(res[1].innerText == "two");

See Also

Document.bySelector

Meta