title: how to get attribute value using selenium and css
body: <p>I have the following HTML code: </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;a href="/search/?p=2&amp;q=move&amp;mt=1"&gt; 2 &lt;/a&gt;
  </code></pre>
  
  <p>I would like to get what is contained in href, ie, I was looking for a command which would give me "/search/?p=2&amp;q=move&amp;mt=1" value for href. </p>
  
  <p>Could someone please help me with the respective command and css locator in selenium, for the above query?</p>
  
  <p>if I have something like: </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a href="/search/?p=2&amp;q=move&amp;mt=1"&gt; 2 &lt;/a&gt; 
  &lt;a href="/search/?p=2&amp;q=move&amp;mt=2"&gt; 3 &lt;/a&gt; 
  </code></pre>
  
  <p>Out of these two if I was to get the attribute value for href whose text conatins '2', then how would my css locator synatx look like? </p>