title: How to extract multiple elements from XPath Selenium (Python)
body: <p>I made this XPath </p>
  
  <pre><code>alo1 = driver.find_element(By.XPATH, "//div[@class='txt-block']/span/a/span").text
  print(alo1)
  </code></pre>
  
  <p>but the problem is: i'm getting only the first element, but there is 3 or 4 elements with the same XPath, and i wanted then all. </p>
  
  <p>From page to page the number of elements change from 0 to 4.</p>
  
  <p>How can i do it?</p>
  
  <p>And other thing, do you think is possible to make another XPath? I'm trying to get the name of the producers of the films.</p>
  
  <p>EDIT:</p>
  
  <p>I have a second difficulty. I'm passing this result to an excel sheet, but it needs to be in one line to be printed there, or else will only print the last one. How can it be done? ,</p>
  
  <pre><code>wb = xlwt.Workbook()
  ws = wb.add_sheet("A Test Sheet")
  driver = webdriver.Chrome()
  driver.get('http://www.imdb.com/title/tt4854442/?ref_=wl_li_tt')
  labels = driver.find_elements_by_xpath("//div[@class='txt-
  block']/span/a/span")
  for label in labels:
     print (label.text)
  ws.write(x-1,1,label.text)
  wb.save("sinopses.xls")
  </code></pre>
  
  <p>The website for reference: <a href="http://www.imdb.com/title/tt4854442/?ref_=wl_li_tt" rel="nofollow noreferrer">http://www.imdb.com/title/tt4854442/?ref_=wl_li_tt</a></p>