How to Find XPath Using Firebug
You can find XPath information for website elements using most browsers' developer tools. Firebug for Firefox allows you to copy XPath information directly to your clipboard. For most other browsers, you can find the XPath information for...
Method 1 of 4:
Using Firefox and Firebug
-
How to Find XPath Using Firebug Picture 1
Install Firebug for Firefox. Firebug is a web inspector add-on for Firefox.- Click the Firefox Menu button (☰) and select "Add-ons."
- Click "Get Add-ons" and then click the "Get more add-ons!" button.
- Search for "Firebug" and then click the "Add to Firefox" button next to it.
- Confirm that you want to install Firebug and then restart Firefox when prompted.
-
How to Find XPath Using Firebug Picture 2
Open the website that you want to inspect. You can use Firebug to inspect any element on a website to find the XPath. -
How to Find XPath Using Firebug Picture 3
Click the Firebug button. You'll find this in the upper-right corner of the window. This will open the Firebug panel at the bottom of the Firefox window. -
How to Find XPath Using Firebug Picture 4
Click the element inspector button. You'll find this in the top row of buttons in the Firebug panel at the bottom of the window, directly to the right of the Firebug Options button. It looks like a box with a mouse cursor pointing at it. -
How to Find XPath Using Firebug Picture 5
Click the web page element that you want to inspect. As you move your cursor over the web page, you'll see different elements get highlighted. Click the one that you want to find the XPath for. -
How to Find XPath Using Firebug Picture 6
Right-click the highlighted code in the Firebug panel. When you click an element in a web page, it's related code will be highlighted in the Firebug panel at the bottom of the window. Right-click this highlighted code. -
How to Find XPath Using Firebug Picture 7
Select "Copy XPath" from the menu. This will copy the element's XPath information to your clipboard.- If you select "Copy Minimal XPath," just the basic XPath information will be copied.
-
How to Find XPath Using Firebug Picture 8
Paste the copied XPath information elsewhere. Once the code is copied, you can simply paste it anywhere else you need by right-clicking and selecting "Paste."
Method 2 of 4:
Using Chrome
-
How to Find XPath Using Firebug Picture 9
Open the website you want to inspect in Chrome. You don't need any extensions installed to be able to find the XPath information of website elements when you're using Chrome. -
How to Find XPath Using Firebug Picture 10
Press .F12 to open the website inspector. This will appear on the right side of the window. -
How to Find XPath Using Firebug Picture 11
Click the element inspector button. You'll find this in the top-left corner of the website inspector panel. The button looks like a box with a mouse cursor pointing at it. -
How to Find XPath Using Firebug Picture 12
Click the element on the website that you want to inspect. You'll see the elements of the site highlight as you move your cursor over them. -
How to Find XPath Using Firebug Picture 13
Right-click the highlighted code in the inspector panel. When you click an element with the inspector, the relevant code will highlight automatically in the inspector panel on the right side of the window. Right-click the highlighted code. -
How to Find XPath Using Firebug Picture 14
Select "Copy" → "Copy XPath." This will copy the element's XPath information to your clipboard.- Note that this just copies the minimal XPath information. Firebug for Firefox can give you the full XPath information.
-
How to Find XPath Using Firebug Picture 15
Paste the copied XPath information. You can paste your copied XPath information like you would any copied information by right-clicking in a text field and selecting "Paste."
Method 3 of 4:
Using Safari
-
How to Find XPath Using Firebug Picture 16
Click the Safari menu and select "Preferences." You'll need to enable the Develop menu in order to access the Web Inspector utility. -
How to Find XPath Using Firebug Picture 17
Click the "Advanced" tab. This will display advanced Safari settings. -
How to Find XPath Using Firebug Picture 18
Check the "Show Develop menu in menu bar" box. The Develop menu will appear immediately in the menu bar. -
How to Find XPath Using Firebug Picture 19
Open the website you want to inspect. Close the Preferences menu and visit the website that contains the element that you want to the get XPath for. -
How to Find XPath Using Firebug Picture 20
Click the Develop menu and select "Show Web Inspector." The Web Inspector panel will appear at the bottom of the window. -
How to Find XPath Using Firebug Picture 21
Click the "Start element selection" button. It looks like a crosshair, can can be found in the top row of buttons in the Web Inspector panel. -
How to Find XPath Using Firebug Picture 22
Click the element on the website that you want to inspect. This will highlight the code for that element in the Web Inspector panel at the bottom of the window. -
How to Find XPath Using Firebug Picture 23
Note the XPath information at the top of the tree. You can't directly copy the XPath, but you can see the full path laid out above the code displayed in the Web Inspector. Each tab is a path expression.[1]
Method 4 of 4:
Using Internet Explorer
-
How to Find XPath Using Firebug Picture 24
Open the website you want to inspect in Internet Explorer. You don't need to install anything to find the XPath in Internet Explorer. Open the website that contains the element you want to inspect. -
How to Find XPath Using Firebug Picture 25
Press F12 to open the developer tools. The developer tools panel will appear at the bottom of the window. -
How to Find XPath Using Firebug Picture 26
Click the "Select element" button. You'll find this in the upper-left corner of the developer tools panel. -
How to Find XPath Using Firebug Picture 27
Click the element on the web page that you want to inspect. This will select it and highlight the code for it in the DOM Explorer. -
How to Find XPath Using Firebug Picture 28
Note the XPath information at the bottom of the panel. Each of the tabs along the bottom of the panel is an XPath expression for the element you have selected. You cannot copy it in XPath format like you can in Firefox with Firebug.
4 ★ | 1 Vote
You should read it
- Inspect Element: How to temporarily edit any website?
- Pseudo-Element in CSS
- FILTERXML - Function that returns specified data from XML content using the specified XPath in Excel
- Learn about Firefox's Web Developer Tools
- 5 changes on Firefox 15
- HTML DOM element in AngularJS
- Box Model (Box Model) in CSS
- Padding in CSS
- Outline in CSS
- Open Inspect Element and View Source on Microsoft Edge browser
- Canvas element in HTML5
- Max-width, maximum element width in CSS