Find an element by `id` within a `dom_node`. The `target_id` can optionally start with '#'. Returns a wrapped `Element` or `None` if not found.
(dom_node, target_id)
| 216 | |
| 217 | |
| 218 | def _find_by_id(dom_node, target_id): |
| 219 | """ |
| 220 | Find an element by `id` within a `dom_node`. |
| 221 | |
| 222 | The `target_id` can optionally start with '#'. Returns a wrapped `Element` |
| 223 | or `None` if not found. |
| 224 | """ |
| 225 | element_id = target_id[1:] if target_id.startswith("#") else target_id |
| 226 | result = dom_node.querySelector(f"#{element_id}") |
| 227 | return _wrap_if_not_none(result) |
| 228 | |
| 229 | |
| 230 | def _find_and_wrap(dom_node, selector): |
no test coverage detected