🚀 We are hiring! See open positions

How to select following siblings using CSS selectors?

by scrapecrow Apr 20, 2023

To select the following sibling (i.e. sibling that is below the current element) the + and ~ combinators can be used.

The ~ selects any following general sibling:

<article> <p>ignore</p> <p class="ad">ignore</p> <p>select</p> <p>select</p> </article>

The + selects one following adjacent sibling (i.e. has to be right below it):

<article> <p>ignore</p> <p class="ad">ignore</p> <p>select</p> <p>ignore</p> </article>

Related Articles

How to Parse XML

In this article, we'll explain about XML parsing. We'll start by defining XML files, their format and how to navigate them for data extraction.

PYTHON
CSS-SELECTORS
XPATH
DATA-PARSING
How to Parse XML

Ultimate CSS Selector Cheatsheet for Web Scraping and HTML Parsing

Complete CSS selector cheatsheet for web scraping. Master navigation, attributes, and pseudo-selectors with interactive examples.

CSS-SELECTORS
DATA-PARSING
WEB-SCRAPING
Ultimate CSS Selector Cheatsheet for Web Scraping and HTML Parsing

Web Scraping With Ruby

Introduction to web scraping with Ruby. How to handle http connections, parse html files for data, best practices, tips and an example project.

RUBY
HTTP
DATA-PARSING
CSS-SELECTORS
XPATH
INTRO
Web Scraping With Ruby

Web Scraping With NodeJS and Javascript

In this article we'll take a look at scraping using Javascript through NodeJS. We'll cover common web scraping libraries, frequently encountered challenges and wrap everything up by scraping etsy.com

NODEJS
HTTP
DATA-PARSING
CSS-SELECTORS
INTRO
Web Scraping With NodeJS and Javascript

Parsing HTML with CSS Selectors

Introduction to using CSS selectors to parse web-scraped content. Best practices, available tools and common challenges by interactive examples.

DATA-PARSING
CSS-SELECTORS
Parsing HTML with CSS Selectors

Best Web Scraping Tools in 2026

Comprehensive guide to choosing web scraping tools for production. Learn the scraping pipeline framework and how to combine tools like Scrapfly, BeautifulSoup, Playwright, and Scrapy for reliable data extraction at scale.

PYTHON
NODEJS
WEB-SCRAPING
Best Web Scraping Tools in 2026