Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are two problems as far as I can see:</p> <ul> <li><p>You're only scanning for anchor tags in the current context. You probably want to extend to scan everywhere (use <code>//</code> in the beginning of your query):</p> <pre class="lang-none prettyprint-override"><code>//a[@class='shackmsg']/@href/substring-after(., '?id=') </code></pre> <p><em>Note that I removed a pair of unnecessary parenthesis.</em></p></li> <li><p>If I'm not completely mistaken, HTML Agility Pack only supports XPath 1.0 (yet I'm not totally sure). While <code>System.Xml.XPath</code> says it implements the XPath 2.0 data model, it does not actually implement XPath 2.0 (probably this is done so third party APIs can implement this API and offer XPath 2.0/XQuery support at the same time). Also have a look at <a href="https://groups.google.com/forum/#!topic/microsoft.public.dotnet.xml/aUFPG94LtCM" rel="nofollow">this discussion on .NET's XPath 2.0 support</a>.</p></li> </ul> <p>Missing XPath 2.0 support would show up as two problems:</p> <ol> <li><p>Function <code>substring-after(...)</code> does not exist.</p> <p>A solution for your problem could be to use <code>string-lenght($string)</code> and <code>substring($string, $start, $length)</code> to extract the last n digits, or <code>translate(...)</code> to remove some characters:</p> <pre class="lang-none prettyprint-override"><code>translate('?id=31219008', '?id=', '') </code></pre> <p>will remove all occurences in the character class <code>[?id=]</code> (yet it is none, I just want to highlight it does not match strings, but individual characters of this set!).</p></li> <li><p>You cannot apply functions in axis steps. This means, you cannot find the maximum value of substrings.</p> <p>Possible solution: Only fetch all substrings and find the maximum from outside XPath.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload