Getting HTML elements via XPath in bash <p>I was trying to parse a page (<a href="http://www.kaggle.com/competitions" rel="nofollow">Kaggle Competitions</a>) with <code>xpath</code> on MacOS as described in <a href="http://stackoverflow.com/questions/4984689/bash-xhtml-parsing-using-xpath">another</a> SO question:</p> <pre><code>curl "https://www.kaggle.com/competitions/search?SearchVisibility=AllCompetitions&amp;ShowActive=true&amp;ShowCompleted=true&amp;ShowProspect=true&amp;ShowOpenToAll=true&amp;ShowPrivate=true&amp;ShowLimited=true&amp;DeadlineColumnSort=Descending" -o competitions.html cat competitions.html | xpath '//*[@id="competitions-table"]/tbody/tr[205]/td[1]/div/a/@href' </code></pre> <p>That's just getting a <code>href</code> of a link in a table.</p> <p>But instead of returning the value, <code>xpath</code> starts validating <code>.html</code> and returns errors like <code>undefined entity at line 89, column 13, byte 2964</code>.</p> <p>Since <code>man xpath</code> doesn't exist and <code>xpath --help</code> ends with nothing, I'm stuck. Also, many similar solutions relate to <code>xpath</code> from GNU distributions, not in MacOS.</p> <p>Is there a correct way of getting HTML elements via XPath in bash?</p>