python-amazon-simple-product-api
python-amazon-simple-product-api copied to clipboard
Accessing returned values for Item and Package Dimensions
The following information is returned by Bottlenose. How can I access it?
<ItemDimensions> <Height Units="hundredths-inches">1350</Height> <Length Units="hundredths-inches">1130</Length> <Weight Units="hundredths-pounds">990</Weight> <Width Units="hundredths-inches">750</Width> </ItemDimensions>
<PackageDimensions> <Height Units="hundredths-inches"> 1098 </Height> <Length Units="hundredths-inches"> 1701 </Length> <Weight Units="hundredths-pounds"> 1280 </Weight> <Width Units="hundredths-inches"> 1449 </Width> </PackageDimensions>
Hi @JasonCrowe
You can use _safe_get_element()
function
print("Height:" + str(product._safe_get_element("ItemAttributes.ItemDimensions.Height")))
Will print
Height:400