title: get find_elements_by_xpath to return 'none' or empty string when element not found :signal missing elements in sequence with selenium
body: <p>I am trying to extract some attributes from this webpage. 
  url='<a href="http://m.search.allheart.com/?q=stethoscope" rel="nofollow">http://m.search.allheart.com/?q=stethoscope</a>'</p>
  
  <p>I wrote the following xpaths for this -:</p>
  
  <pre><code>XPATH,ATTRIBUTE='XPATH','ATTRIBUTE'
  NUM_RESULTS='NUM_RESULTS'
  URL='URL'
  TITLE='TITLE'
  PROD_ID='PROD_ID'
  IS_SALE='IS_SALE'
  CURRENCY='CURRENCY'
  REGULAR_PRICE='REGULAR_PRICE'
  SALE_PRICE='SALE_PRICE'
  
  conf_key={
  
  NUM_RESULTS : {XPATH :'//div[@id="sort-page"]//div[@id="options" and @class="narrowed"]//hgroup[@id="sort-info" and @class="clearfix"]/h2', ATTRIBUTE:''} ,
  URL : {XPATH:'//span[@class="info"]//span[@class="swatches clearfix product-colors"]//span[@class="price"]',ATTRIBUTE:'href'} ,
  TITLE : {XPATH:'//div[@id="sort-results"]//li[@class="item product-box"]//span[@class="info"]//span[@class="title"]',ATTRIBUTE:''} ,
  PROD_ID : {XPATH:'//div[@id="sort-results"]//li[@class="item product-box"]//span[@class="info"]//span[@class="swatches clearfix product-colors"]',ATTRIBUTE:'id'} ,
  IS_SALE : {XPATH :'//div[@id="sort-results"]//li[@class="item product-box sale"]', ATTRIBUTE:''} ,
  REGULAR_PRICE : {XPATH :'//div[@id="sort-results"]//li[@class="item product-box"]//span[@class="info"]//span[@class="price"]' , ATTRIBUTE:''} ,
  SALE_PRICE : {XPATH :'//div[@id="sort-results"]//li[@class="item product-box sale"]//span[@class="info"]//span[@class="price"]' , ATTRIBUTE: '' } ,
  }
  
   chromedriver = "/usr/local/CHROMEDRIVER"
   desired_capabilities=DesiredCapabilities.CHROME
   os.environ["webdriver.chrome.driver"] = chromedriver
   driver = webdriver.Chrome(chromedriver,desired_capabilities=desired_capabilities)
   driver.get(url)
  </code></pre>
  
  <p>The idea is to extract the attributes from the 1st search page to get the name , url, title, regular price &amp; sale price. </p>
  
  <p>Skipping the rest of the code.. and later extract the text through a for loop.
  When I try to get the items on sale, </p>
  
  <pre><code>driver.find_elements_by_xpath(conf_key[SALE_PRICE][XPATH])
  driver.find_elements_by_xpath(conf_key[REGULAR_PRICE][XPATH])
  </code></pre>
  
  <p><strong>However this gives me , regular_price,sale_price,is_sale as</strong> 
  ['$5.98', '$5.98', '$24.98', '$3.98', '$6.98', '$13.98', '$24.98', '$19.98', '$18.98', '$3.98', '$5.98', '$24.98', '$12.98', '$24.98'] ['$49.99', '$96.99'] [1, 1]</p>
  
  <p>while I would like -:</p>
  
  <pre><code>['$5.98', '$5.98', '$24.98','$49.99', '$3.98', '$6.98', '$13.98', '$24.98', '$19.98', '$18.98', '$3.98', '$5.98',  '$96.99', '$24.98', '$12.98', '$24.98']
  ['','', '24.98', '' , '' ....]
  [0, 0, 1, 0 , 0 ...]
  </code></pre>
  
  <p><strong>Question -:</strong> 
  <strong>I would like to force the driver to return '' (or any placeholder) , so that I can have the signal that the product was not on sale.</strong> 
  The webpage will either have the class - : "item product-box" , or "item product-box-sale " </p>
  
  <p>Also, I do not want to hard code this, since I need to repeat this logic for a set of web-pages. How can I do this better without looping through li[0], li[1] .. and so on. 
  Is there any method that exists to signal that class was not present when scanned in order ? </p>
  
  <p><strong>Using the Xpath's defined above, I do get the rest of the container correctly as -:</strong></p>
  
  <pre><code>SEARCH_PAGE
  244 Items ['ah426010', 'ahdst0100', 'ahdst0500blk', 'ahd000090', 'ahdst0600', 'pms1125', 'ahdst0400bke', 'ahdst0400blk', 'adc609', 'ma10448', 'ma10428', 'pm121', 'pm108', 'pm122']  ['allheart Discount Dual Head Stethoscope', 'allheart Discount Single Head Stethoscope', 'allheart Cardiology Stethoscope', 'allheart Disposable Stethoscope', 'allheart Discount Pediatric / Infant Stethoscope With Interchangeable Heads Stethoscope', 'Prestige Medical Ultra-Sensitive Dualhead Latex Free Stethoscope', 'allheart Smoke Black Edition Clinical Stainless Steel Stethoscope', 'allheart Clinical Stainless Steel Stethoscope', 'ADC Adscope-Lite 609 Lightweight Double-Sided Stethoscope', 'Mabis Dispos-A-Scope Nurse Stethoscope', 'Mabis Spectrum Nurse Stethoscope', 'Prestige Medical Clinical Lite Stethoscope', 'Prestige Medical Dual Head Stethoscope', 'Prestige Medical Sprague Rappaport Stethoscope'] 
  </code></pre>
  
  <p>And I need to get the lists of same length, corresponding to each of these, for Regular &amp; sale price(and is_sale flag) </p>