We rebuilt our website from scratch and are still updating some extensions and pages. Having a problem? Sign in and open a support ticket or contact us.
JoomBoost

Get XPath Content

Get XPath Content extracts parts of HTML with an XPath query. Use it to take one block of a page, such as the article body or a price.

Input and output

  • Input: html, such as the content of the Links engine or the full_html of Get Fulltext.
  • Output: html with every element the query found.

Options

  • XPath Query: the query. JoomGrabber puts the input inside <div id="xpath_extractor"> and your query is added after //div[@id='xpath_extractor']. So you write the rest of the path, starting with //.
  • Node wrap: a tag name to wrap each found element in, such as p or div. Leave empty to keep the elements as they are.

Examples

You want XPath Query
The article body //div[@class='article-body']
Every paragraph //p
The main image //figure[1]//img
A block by ID //*[@id='content']
Elements with a class among others //div[contains(@class,'entry')]

Tips

  • In Chrome or Firefox, right-click the element, choose Inspect, then Copy > Copy XPath. Remove anything before the part you need, and start with //.
  • XPath is case-sensitive: @class='Article' does not match article.
  • @class='a' only matches when the class is exactly a. Use contains(@class,'a') when the element has several classes.

All Extensions