How to get XPath of HTML element?

How to get XPath of HTML element?

Follow the below steps to get XPath of HTML element.

Step 1: Open browser, I am using Chrome

Step 2: Go to google.com

Step 3: Right-click on the element of which XPATH is needed.

Right-click on the element

Step 4: Click on Inspect

image.png

Step 5: Right click on HTML tag (input tag) and follow till Copy XPath and click on it. Voila! 🎉 XPath is copied to your clipboard.

Right click on HTML tag (input tag) and follow till Copy XPath

Read more about XPath at developer.mozilla.org/en-US/docs/Web/XPath

Thank you!

 
Share this