How to Parse XML
In this article, we'll explain about XML parsing. We'll start by defining XML files, their format and how to navigate them for data extraction.
The concat()
function is an XPath expression is a string join function for multiple string values. It's useful when parsing an HTML document for a specific string through distributed multiple elements or attributes:
For example, let's see the below interactive XPath expression evaluation:
Above, we contact the name and price elements into a single string. However, we can join any number of elements. Here's an example through two or more arguments:
Note that concat()
only works with strings so it'll automatically try convert elements to their text()
values. For further details on XPath selectors, including common tips and tricks, refer to our dedicated guide.
This knowledgebase is provided by Scrapfly data APIs, check us out! 👇