title: How to print the third instance of an attribute using Cheerio JS
body: <p>There is 3 instances of 'authenticity_token' in this html:</p>
  <pre><code>&lt;form class=&quot;edit_checkout&quot; action=&quot;/942252/checkouts/624527ae778897e534d917b52af2eb28&quot; accept-charset=&quot;UTF-8&quot; method=&quot;post&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;patch&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;authenticity_token&quot; value=&quot;5vK3h2ocwaKm0hZ+AH3HAtnffe9l7hQHIMDfrMPusFhxtSV6IbLBfWOnBboOBysF7NyDPQ7GNxdfcWUPOk5WSQ==&quot; /&gt;
  
  &lt;form class=&quot;edit_checkout&quot; action=&quot;/942252/checkouts/624527ae778897e534d917b52af2eb28&quot; accept-charset=&quot;UTF-8&quot; method=&quot;post&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;patch&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;authenticity_token&quot; value=&quot;Fkw7j/Wv0Xxhna1aWNh8FsZhNnXz4zu0vFuTV0q9WJ6BC6lyvgHRo6Tovp5WopAR82LIp5jLGKTD6in0sx2+jw==&quot; /&gt;
  
  &lt;form class=&quot;edit_checkout&quot; data-payment-form=&quot;&quot; action=&quot;/942252/checkouts/624527ae778897e534d917b52af2eb28&quot; accept-charset=&quot;UTF-8&quot; method=&quot;post&quot;&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;patch&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;authenticity_token&quot; value=&quot;Bs1PNacx4rK5TJcl+VDO+RXnR69DixOH+osJ/yxuQQeRit3I7J/ibXw5hOH3KiL+IOS5fSijMJeFOrNc1c6nFg==&quot; /&gt;
  </code></pre>
  <p>The actual token (the value I want) is the value attribute and in this case I want the 3rd instance of 'authenticity_token'.</p>
  <p>All 3 instances start with <code>&lt;form class=&quot;edit_checkout&quot;</code> but the third is followed by <code>data-payment-form=&quot;&quot;</code> instead of <code>action=&quot;/</code> . so I know the one I want is the one that includes <code>data-payment-form</code></p>
  <p>I tried using this code in Cheerio:</p>
  <pre><code>$('form.edit_checkout input['name=&quot;authenticity_token&quot;']')
  </code></pre>
  <p>But that returns the first auth token on the first line and I need the auth token on the third line.</p>
  <p>Thanks!</p>