scraper icon indicating copy to clipboard operation
scraper copied to clipboard

How to select in pairs?

Open extf33 opened this issue 1 year ago • 1 comments

How to select only pre.CCC with "Hello, Rust!" immediately before it, in the code below?

<section id="AAA">
    <p class="BBB">Hello, Rust!</p>
    <pre class="CCC">...</pre> ----------> O
    <p>...</p>
    <pre class="CCC">...</pre> ----------> X
</section>

extf33 avatar Apr 05 '23 07:04 extf33

Did you try p.BBB + pre.CCC which selects the pre.CCC if it is immediately preceded by p.BBB? If you try select based on Hello, Rust!, then this not yet possible with CSS selectors AFAIK.

adamreichold avatar Apr 05 '23 09:04 adamreichold