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

  1. Picture 1 of How to Find XPath Using Firebug
    Install Firebug for Firefox. Firebug is a web inspector add-on for Firefox.
    1. Click the Firefox Menu button (☰) and select "Add-ons."
    2. Click "Get Add-ons" and then click the "Get more add-ons!" button.
    3. Search for "Firebug" and then click the "Add to Firefox" button next to it.
    4. Confirm that you want to install Firebug and then restart Firefox when prompted.
  2. Picture 2 of How to Find XPath Using Firebug
    Open the website that you want to inspect. You can use Firebug to inspect any element on a website to find the XPath.
  3. Picture 3 of How to Find XPath Using Firebug
    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.
  4. Picture 4 of How to Find XPath Using Firebug
    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.
  5. Picture 5 of How to Find XPath Using Firebug
    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.
  6. Picture 6 of How to Find XPath Using Firebug
    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.
  7. Picture 7 of How to Find XPath Using Firebug
    Select "Copy XPath" from the menu. This will copy the element's XPath information to your clipboard.
    1. If you select "Copy Minimal XPath," just the basic XPath information will be copied.
  8. Picture 8 of How to Find XPath Using Firebug
    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

  1. Picture 9 of How to Find XPath Using Firebug
    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.
  2. Picture 10 of How to Find XPath Using Firebug
    Press .F12 to open the website inspector. This will appear on the right side of the window.
  3. Picture 11 of How to Find XPath Using Firebug
    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.
  4. Picture 12 of How to Find XPath Using Firebug
    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.
  5. Picture 13 of How to Find XPath Using Firebug
    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.
  6. Picture 14 of How to Find XPath Using Firebug
    Select "Copy" → "Copy XPath." This will copy the element's XPath information to your clipboard.
    1. Note that this just copies the minimal XPath information. Firebug for Firefox can give you the full XPath information.
  7. Picture 15 of How to Find XPath Using Firebug
    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

  1. Picture 16 of How to Find XPath Using Firebug
    Click the Safari menu and select "Preferences." You'll need to enable the Develop menu in order to access the Web Inspector utility.
  2. Picture 17 of How to Find XPath Using Firebug
    Click the "Advanced" tab. This will display advanced Safari settings.
  3. Picture 18 of How to Find XPath Using Firebug
    Check the "Show Develop menu in menu bar" box. The Develop menu will appear immediately in the menu bar.
  4. Picture 19 of How to Find XPath Using Firebug
    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.
  5. Picture 20 of How to Find XPath Using Firebug
    Click the Develop menu and select "Show Web Inspector." The Web Inspector panel will appear at the bottom of the window.
  6. Picture 21 of How to Find XPath Using Firebug
    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.
  7. Picture 22 of How to Find XPath Using Firebug
    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.
  8. Picture 23 of How to Find XPath Using Firebug
    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

  1. Picture 24 of How to Find XPath Using Firebug
    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.
  2. Picture 25 of How to Find XPath Using Firebug
    Press F12 to open the developer tools. The developer tools panel will appear at the bottom of the window.
  3. Picture 26 of How to Find XPath Using Firebug
    Click the "Select element" button. You'll find this in the upper-left corner of the developer tools panel.
  4. Picture 27 of How to Find XPath Using Firebug
    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.
  5. Picture 28 of How to Find XPath Using Firebug
    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.
Update 05 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile