From 7dd01d3ab46d0615ca75f37696dc4eadde2a1b81 Mon Sep 17 00:00:00 2001 From: Raymond Berger Date: Thu, 30 Jan 2025 19:47:31 -0500 Subject: [PATCH] xpath select first instance --- CSS-Selector-help.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CSS-Selector-help.md b/CSS-Selector-help.md index e0e1e8f..7cd97b1 100644 --- a/CSS-Selector-help.md +++ b/CSS-Selector-help.md @@ -45,6 +45,12 @@ filter: `//h3/parent::a//@href` //img//@src ``` +# Select just the first instance of something +``` +xpath:(//h3[contains(@class, 'PagePromo-title')])[1] +``` +This selects just the first instance of an h3 that contains the class PagePromo-title + # Select by `data-` source ```