title: Print out Certain elements in a List using Python Selenium
body: <p>I am trying to build a web-scraper for Linkedin using Python and Selenium. I am trying to print out the title, but the output is only showing an empty list and I'm not sure why. I have tried printing all elements in the list and using items.text.replace() to replace the common outputs, however, the output was still all elements. I have also tried printing the parent divs, but the output is still an empty list.</p>
  <p>Here is the code I wrote:</p>
  <pre><code>#search
  driver.find_element_by_xpath(&quot;//*[@id='ember16']/input&quot;).send_keys(&quot;Steve Jobs&quot;)
  driver.find_element_by_xpath(&quot;//*[@id='ember16']/input&quot;).send_keys(Keys.RETURN)
  
  driver.implicitly_wait(3)
  
  #result count
  resultCount = driver.find_element_by_xpath(&quot;//*[@id='ember64']/div/h3&quot;)
  print(&quot;\n&quot; + str(resultCount.text))
  
  #printing
  results = driver.find_elements_by_xpath('//*[@id=&quot;ember64&quot;]/div/ul')
  
  for items in results:
      print(str(driver.find_elements_by_xpath('//*[@id=&quot;ember552&quot;]/div/div[2]/p[1]'))+&quot;\n&quot;)
  </code></pre>
  <p>Here is the output:</p>
  <pre><code>About 43,000 results
  []
  
  Process finished with exit code 0
  </code></pre>
  <p><strong>Is there anyway to specify the element to print while iterating through a list?</strong></p>
  <p>EDIT:
  Here is a minimal reproducible example of this code:</p>
  <pre><code># search url
  url = 'https://www.linkedin.com/search/results/people/?keywords=Steve%20Jobs&amp;origin=GLOBAL_SEARCH_HEADER'
  driver.get(url)
  
  # print job title
  results = driver.find_elements_by_xpath('//*[@id=&quot;ember64&quot;]/div/ul')
  for items in results:
  
      print(driver.find_elements_by_xpath('//*[@id=&quot;ember552&quot;]/div/div[2]/p[1]')) 
  </code></pre>
  <p>Here is the output:</p>
  <pre><code>[]
  
  
  Process finished with exit code 0
  </code></pre>