title: XPath Wildcards for HTML
body: <p>I'm using XPath to extract DOM elements values.
  Since the XPaths aren't consistent, I'm using some wildcard magic to select all DOM elements on the same level.</p>
  
  <p>Example XPaths in HTML document:</p>
  
  <pre><code>//div[@id='floatswrap']/div/div[2]/div[1]
  //div[@id='floatswrap']/div/div[2]/div[2]
  //div[@id='floatswrap']/div/div[2]/div[3]
  ......
  //div[@id='floatswrap']/div/div[2]/div[100]
  </code></pre>
  
  <p>I've tried the <code>*/div[@id='floatswrap']/div/div[2]/div</code> wildcard (note the asterisk character at the beginning and no square brackets at end), but it fails.
  So I'm using the following (example code for above):
  <code>//div[@id='floatswrap']/div/div[2]/div[*]</code> (note the asterisk inside brackets) and it woks for now.</p>
  
  <p>Since I'm new to XPath, is there a better and more consistent way to make XPath node selection using wildcards?</p>
  
  <p><strong>EDIT:</strong>
  Suppose I have the following HTML:</p>
  
  <pre><code> &lt;html&gt;
   &lt;head&gt;
   &lt;/head&gt;
      &lt;body&gt;
        &lt;div id="floatswrap"&gt;
          &lt;div&gt;
           &lt;div&gt;First&lt;/div&gt;
           &lt;div&gt;                     &lt;!-- SELECT ALL DIV NODES WRAPPED IN THIS DIV --&gt;
            Second
  
             &lt;div&gt;One&lt;/div&gt;                     &lt;!-- SELECT THIS NODE --&gt;
             &lt;div&gt;Two&lt;/div&gt;                     &lt;!-- SELECT THIS NODE --&gt;
             &lt;div&gt;Three&lt;/div&gt;                   &lt;!-- SELECT THIS NODE --&gt;
             &lt;!-- ........ --&gt;                  &lt;!-- SELECT ALL DIV NODES --&gt;
             &lt;div&gt;Hundred&lt;/div&gt;                 &lt;!-- SELECT THIS NODE --&gt;
           &lt;/div&gt; &lt;!-- ./Second DIV --&gt;
         &lt;/div&gt;
         &lt;div&gt; Some Text &lt;/div&gt;         
         &lt;div&gt; Some Other Text &lt;/div&gt;
        &lt;/div&gt; &lt;!-- ./floatswrap --&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm trying to select all DIVs in the second DIV.</p>