Example – Daily deals
Using a structured querying language like XPath, you can easily collect unformatted data as well. In our previous examples, we've mostly looked at the prices of products. Prices are simpler to deal with because they generally follow a specific format. For example, you can use regular expressions to look for a dollar sign, followed by a one or more digits, a period, and two more digits. On the other hand, if you wanted to retrieve a block or multiple blocks of text where the content had no format, it would become more difficult to do so with basic string searches. XPath simplifies this by allowing you to retrieve all of the text content inside of a node.
The Go standard library has basic support for the handling of XML ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access