title: How to select the first n elements in XPath
body: <p>I am using YQL to scrape some images from a website. </p>
  
  <p>The problem is I want only the first 5 images from that website.</p>
  
  <p>I have the following query:</p>
  
  <pre><code>select * from html where url="http://myanimelist.net/anime/9253/Steins;Gate" and xpath='//img[position()&lt;=5]'
  </code></pre>
  
  <p>But, it is returning all image elements instead of the first 5. </p>
  
  <p>YQL console: <a href="https://developer.yahoo.com/yql/console/#h=select+*+from+html+where+url%3D%22http%3A%2F%2Fmyanimelist.net%2Fanime%2F9253%2FSteins%3BGate%22+and+xpath%3D&#39;%2F%2Fimg%5Bposition()%3C%3D5%5D&#39;" rel="nofollow">open YQL console with above XPath</a></p>
  
  <p>Is there anything wrong with my XPath query ?</p>
  
  <p>PS: I cannot use <code>LIMIT 5</code> since I may need to scrape some other tags too. </p>