title: get all elements in a loop through xpath
body: <p>I am currently learning selenium using python</p>
  
  <p>html is:</p>
  
  <pre><code>&lt;ol class="item-section"&gt;
  &lt;li&gt;
     &lt;div class="abc xyz"&gt;
             &lt;div class="foo qwe"&gt;
                   &lt;a href="/watch123"&gt;&lt;/a&gt;
             &lt;/div&gt;
     &lt;/div&gt;           
  &lt;/li&gt;
  &lt;li&gt;
       &lt;div class="abc xyz"&gt;
             &lt;div class="foo qwe"&gt;
                   &lt;a href="/watch456"&gt;&lt;/a&gt;
             &lt;/div&gt;
     &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
       &lt;div class="abc xyz"&gt;
             &lt;div class="foo qwe"&gt;
                   &lt;a href="/watch678"&gt;&lt;/a&gt;
             &lt;/div&gt;
     &lt;/div&gt;
  &lt;/li&gt;
  &lt;/ol&gt;
  </code></pre>
  
  <p>I want to get all hrefs from the list, through xpath
  I tried</p>
  
  <pre><code>html_list = driver.find_element_by_class_name("item-section")
      items = html_list.find_elements_by_tag_name("li")
      stack=[]
      index = 1
      for item in items:
          index+=1
          link = item.find_element_by_xpath("//div[@class='foo qwe']["+index+"]/a")
          print (index,"---&gt;  ",link.get_attribute("href"))
  </code></pre>
  
  <p>but it gives error <code>Can't convert 'int' object to str implicitly</code> 
  If I just use</p>
  
  <pre><code>link = item.find_element_by_xpath("//div[@class='foo qwe']/a")
  </code></pre>
  
  <p>I get the first href multiple times</p>