<li id="result_1418" data-asin="B01CZ654Q6" class="s-result-item s-result-card-for-container s-carded-grid celwidget ">
>>> from lxml import etree
>>> str1 = '<li id="result_1418" data-asin="B01CZ654Q6" class="s-result-item s-result-card-for-container s-carded-grid celwidget "></li>'
>>> elem = etree.fromstring(str1)
>>> elem.get('data-asin')
'B01CZ654Q6