尝试以下循环:
products = driver.find_elements_by_xpath('//li[starts-with(@id, "result_")]')
for product in products:
title = product.find_element_by_tag_name('h2').text
price = ([item.text for item in product.find_elements_by_xpath('.//a/span[contains(@class, "a-color-base")]')] + ["No price"])[0]
review = ([item.get_attribute('textContent') for item in product.find_elements_by_css_selector('i.a-icon-star>span.a-icon-alt')] + ["No review"])[0]
asin = product.get_attribute('data-asin') or "No asin"
print(title, price, review, asin)