Note that there are some explanatory texts on larger screens.

plurals
  1. POXPath partial of attribute known
    primarykey
    data
    text
    <p>I know the partial value of an attribute in a document, but not the whole thing. Is there a character I can use to represent any value? For example, a value of a label for an input is "A. Choice 1". I know it says "Choice 1", but not whether it will say "A. " or "B. " before the "Choice 1". Below is the relevant HTML. There are other attributes for the input and the label, but they are not the same every time the page is rendered, so I can't use them as references:</p> <pre><code>&lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;label&gt;A. Choice 1&lt;/label&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;label&gt;B. Choice 2&lt;/label&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;label&gt;C. Choice 3&lt;/label&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;label&gt;D. Choice 4&lt;/label&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>This is the <a href="http://en.wikipedia.org/wiki/XPath" rel="noreferrer">XPath</a> expression I'm using to select the input next to the label with the value of "Choice 1", except that the A is in front of it in the HTML:</p> <pre><code>//td[label="Choice 1"]/input </code></pre> <p>I don't know if the A in the HTML will be an A, B, or C, etc. But I do know that the correct input will always have the Choice 1 text next to it. How do I say to select it if the label <em>contains</em> Choice 1, as opposed to <em>being equal to</em> choice 1?</p>
    singulars
    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.
 

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