title: How to iterate over WebElements and get a new WebElement in Robot Framework
body: <p>I am trying to get <code>href</code> attribute from an <code>html</code> list using <code>Robot Framework keywords</code>. For example suppose the <code>html</code> code</p>
  
  <pre><code>&lt;ul class="my-list"&gt;
  &lt;li class="my-listitem"&gt;&lt;a href="..."&gt;...&lt;/li&gt;
  ...
  &lt;li class="my-listitem"&gt;&lt;a href="..."&gt;...&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I have tried to use the keywords <code>WebElement</code>, <code>WebElements</code> and <code>for loop</code> without success. How can I do it?</p>
  
  <p>This is my <code>MWE</code></p>
  
  <pre><code>*** Test Cases ***
  @{a tags} =  Create List
  @{href attr} = Create List
  @{li items} = Get WebElements    class:my-listitem
  
  FOR ${li}  IN  @{li items}
      ${a tag} =  Get WebElement    tag:a
      Append To List    @{a tags}    ${a tag}
  END
  
  FOR ${a tag}  IN  @{a tags}
      ${attr} =  Get Element Attribute    css:my-listitem   href
      Append To List    @{href attr}    ${attr}
  END
  </code></pre>
  
  <p>Thanks in advance.</p>