If you want to have all prices in a given interval, you can do the following. If you want to do something else, you can just perform other operation instead of filtering.
prices_elements = find_prices(driver)
prices = extract_prices_values(prices_elements)
prices_between = filter_prices_not_in_interval(prices, 15, 150)
return driver.find_elements_by_xpath("//*[@class='woocommerce-Price-amount amount']")
return [ clean_price_string(price.text) for price in prices_elements ]
return price.replace("₹", "")
def filter_prices_not_in_interval(prices, lower, higher):
return [ price for price in prices if float(price) > lower and float(price) < higher ]
With the finding and filtering functions above, it should be trivial if you want to just the webelement object that meet the criteria, which means you can do anything with the whole object.