Returns the first element within the document that matches the specified group of selectors. @param selectors one or more CSS selectors separated by commas @param the node type @return null if no matches are found; otherwise, it returns the first matching element
(final String selectors)
| 2103 | * @return null if no matches are found; otherwise, it returns the first matching element |
| 2104 | */ |
| 2105 | @SuppressWarnings("unchecked") |
| 2106 | public <N extends DomNode> N querySelector(final String selectors) { |
| 2107 | final DomNodeList<DomNode> list = querySelectorAll(selectors); |
| 2108 | if (!list.isEmpty()) { |
| 2109 | return (N) list.get(0); |
| 2110 | } |
| 2111 | return null; |
| 2112 | } |
| 2113 | |
| 2114 | /** |
| 2115 | * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> |
nothing calls this directly
no test coverage detected