DEV Community

Ajay Galagali
Ajay Galagali

Posted on

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 https://www.google.com/

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

Right-click on the element

Step 4: Click on Inspect

Click on Inspect

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 https://developer.mozilla.org/en-US/docs/Web/XPath

Thank you!

⚠ Check out original blog here

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay