🚀 We are hiring! See open positions

How to select any element using wildcard in XPath?

by Bernardas Alisauskas Oct 14, 2024 1 min read

To select elements of any name the wildcard character * can be used:

<article> <h1>title</h1> <p>paragraph</p> <a>link</a> </article>

Wildcard character functions just like any other axis selector and can have predicates and filters applied to it. For example, we can restrict our wildcard option to a list of names using the name() function:

<article> <h1>title</h1> <p>paragraph</p> <a>link</a> </article>
Scale Your Web Scraping
Anti-bot bypass, browser rendering, and rotating proxies — all in one API. Start with 1,000 free credits.
No credit card required 1,000 free API credits Anti-bot bypass included
Not ready? Get our newsletter instead.