Using parameters in the XPath
<p>I am trying to use parameters in the xpath expression but no luck.</p>

<pre><code>field = //*[@id=%s]/optgroup[@label=%s]/*[contains(@title, %s)]"%(FIELDTYPE, label, fieldtype)
</code></pre>

<p>What am I doing wrong?</p>

<p>Don't forget about the quotes around the placeholders:</p>

<pre><code>"//*[@id='%s']/optgroup[@label='%s']/[contains(@title, '%s')]" % (FIELDTYPE, label, fieldtype)
</code></pre>

<p>Also note that I've also added the <code>*</code> after the <code>//</code>.</p>

python selenium xpath