XPath Exercise
Interactive learning platform: solve XPath challenges from basic to advanced.
Check out our step-by-step guide for QA Selenium Automation Engineers: Learning XPath
Question
HTML Snippet
Raw HTML
Your XPath
XPath Examples
//div[@class='content']
//a[contains(@href, 'example')]
//input[@type='text'][1]
//h1/following-sibling::p
JSONPath Examples
$.users[*].name
$.products[?(@.price > 100)]
$..address.city
$.data[0:2]
RegEx Examples
/\b\w+@\w+\.\w+\b/g (Email addresses)
/\d{3}-\d{3}-\d{4}/g (Phone numbers)
/https?:\/\/[^\s]+/g (URLs)
/^[A-Z][a-z]+$/g (Capitalized words)
Get in Touch
We'd love to hear from you! Choose the method that works best for you: