WillC
WillC

Reputation: 2115

Anglesharp QuerySelectorAll Syntax for "Like Tag"

Is there a way to find custom html tags using LIKE syntax in AngleSharp? I know the syntax follows CSS selectors but have not found a reference in documentation or example that works.

// For all custom tags that start with the "rp-" something like (does not work):

var customTags = doc.QuerySelectorAll("*[tag ^= rp-]");

// This would match <rp-input></rp-input>, <rp-form></rp-form>, etc.

Upvotes: 0

Views: 274

Answers (1)

WillC
WillC

Reputation: 2115

Please post if you have a valid solution with a selector that works, but here is a brute force work around that solves my problem.

 var tags        = doc.QuerySelectorAll("*");
 var customTags  = tags.Where(w => w.LocalName.StartsWith("rp-"));

Upvotes: 0

Related Questions