How to select the first n elements in XPath
问题 I am using YQL to scrape some images from a website. The problem is I want only the first 5 images from that website. I have the following query: select * from html where url="http://myanimelist.net/anime/9253/Steins;Gate" and xpath='//img[position()<=5]' But, it is returning all image elements instead of the first 5. YQL console: open YQL console with above XPath Is there anything wrong with my XPath query ? PS: I cannot use LIMIT 5 since I may need to scrape some other tags too. 回答1: This