{"action":"closed","issue":{"url":"https://api.github.com/repos/spooning/SeleniumLibrary/issues/201","labels_url":"https://api.github.com/repos/spooning/SeleniumLibrary/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/spooning/SeleniumLibrary/issues/201/comments","events_url":"https://api.github.com/repos/spooning/SeleniumLibrary/issues/201/events","html_url":"https://github.com/spooning/SeleniumLibrary/issues/201","id":101418763,"number":201,"title":"Loop through all XPath Matches found and Transfer to a List","user":{"login":"spooning","id":1658993,"avatar_url":"https://avatars.githubusercontent.com/u/1658993?v=3","gravatar_id":"","url":"https://api.github.com/users/spooning","html_url":"https://github.com/spooning","followers_url":"https://api.github.com/users/spooning/followers","following_url":"https://api.github.com/users/spooning/following{/other_user}","gists_url":"https://api.github.com/users/spooning/gists{/gist_id}","starred_url":"https://api.github.com/users/spooning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spooning/subscriptions","organizations_url":"https://api.github.com/users/spooning/orgs","repos_url":"https://api.github.com/users/spooning/repos","events_url":"https://api.github.com/users/spooning/events{/privacy}","received_events_url":"https://api.github.com/users/spooning/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spooning/SeleniumLibrary/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-17T13:17:13Z","updated_at":"2015-08-17T13:17:29Z","closed_at":"2015-08-17T13:17:29Z","body":"> *Originally submitted to [Google Code](http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=201) by robertvi... on 14 Aug 2011*\n\n\nHi,\r\n\r\nRelatively new with the Robot framework and currently trying it out. I have the following requirement:\r\n\r\n1. In a page, I'll run an Xpath query such as the following: \r\n//a[contains(., 'http')]\r\n2. This may then return more than 1 match (NOTE: I cannot pre-determine how many matches there will be in that page as it changes over time, hence Xpath Should Match X Times is not used)\r\n3. I use Get Matching Xpath Count to determine how many matches are actually there\r\n4. From the number of matches, I'd like to be able to get the values of each match and transfer them to a list (i.e. @&#8288;{URLs})\r\n\r\nIs there a way that I can retrieve all the values that matched the Xpath query and use them for succeeding loops or steps?\r\n\r\nAnother thing I'm thinking is, after I get the Xpath count, can I run a loop that will iterate through an Xpath wherein the only thing that changes is one variable?\r\n\r\nExample is the following:\r\nid('affAdFlightDetailsAdList')/x:tbody/x:tr[1]/x:td/x:div[3]/x:ul/x:li[1]/x:a\r\n\r\nThat Xpath was just taken from Firefox, but basically, the table row (tr) value is the only thing that is needed to be changed to get the next match (i.e. change tr[1] to tr[2] while retaining the rest of the Xpath query will yield the next match of the query I used in step #1 above.\r\n\r\nI was unable to find a documentation that indicates if I can use something similar to the following:\r\nid('affAdFlightDetailsAdList')/x:tbody/x:tr[${index}]/x:td/x:div[3]/x:ul/x:li[1]/x:a\r\n\r\nWhich would loop through the data until there's no more matches found. Will placing a variable within a locator work?\r\n\r\nWould greatly appreciate your thoughts. Thank you in advance!\n\n"}}